mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
this is crazy, but call _parse maybe?
This commit is contained in:
parent
010f2ee9bd
commit
1441469d38
|
@ -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)
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user