this is crazy, but call _parse maybe?

This commit is contained in:
Ryan P Kilby 2015-05-28 06:53:47 -04:00
parent 010f2ee9bd
commit 1441469d38
2 changed files with 4 additions and 3 deletions

View File

@ -381,8 +381,7 @@ class Request(object):
return
# At this point we're committed to parsing the request as form data.
self._data = self._request.POST
self._files = self._request.FILES
self._data, self._files = self._parse()
self._full_data = self._data.copy()
self._full_data.update(self._files)

View File

@ -58,6 +58,7 @@ class TestMethodOverloading(TestCase):
reserved form field
"""
request = Request(factory.post('/', {api_settings.FORM_METHOD_OVERRIDE: 'DELETE'}))
request.parsers = (MultiPartParser(), )
self.assertEqual(request.method, 'DELETE')
def test_x_http_method_override_header(self):
@ -66,6 +67,7 @@ class TestMethodOverloading(TestCase):
the X-HTTP-Method-Override header.
"""
request = Request(factory.post('/', {'foo': 'bar'}, HTTP_X_HTTP_METHOD_OVERRIDE='DELETE'))
request.parsers = (MultiPartParser(), )
self.assertEqual(request.method, 'DELETE')
request = Request(factory.get('/', {'foo': 'bar'}, HTTP_X_HTTP_METHOD_OVERRIDE='DELETE'))
@ -148,7 +150,7 @@ class TestContentParsing(TestCase):
api_settings.FORM_CONTENTTYPE_OVERRIDE: content_type
}
request = Request(factory.post('/', form_data))
request.parsers = (JSONParser(), )
request.parsers = (JSONParser(), MultiPartParser(), )
self.assertEqual(request.DATA, json_data)
def test_form_POST_unicode(self):