Check for 200 status when unknown filter requested.

This changes the test from the failing checking for status 400. See
discussion here:

https://github.com/tomchristie/django-rest-framework/pull/169#issuecomment-9240480
This commit is contained in:
Ben Konrath 2012-10-09 08:22:00 +02:00
parent 1e9ece0f93
commit 692203f933

View File

@ -147,14 +147,13 @@ class IntegrationTestFiltering(TestCase):
request = factory.get('/')
self.assertRaises(AssertionError, view, request)
# TODO Return 400 filter paramater requested that hasn't been configured.
def test_bad_request(self):
def test_unknown_filter(self):
"""
GET requests with filters that aren't configured should return 400.
GET requests with filters that aren't configured should return 200.
"""
view = FilterFieldsRootView.as_view()
search_integer = 10
request = factory.get('/?integer=%s' % search_integer)
response = view(request).render()
self.assertEquals(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEquals(response.status_code, status.HTTP_200_OK)