mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Added test for X-HTTP-Method-Override header
This commit is contained in:
parent
104614c600
commit
2e481f3318
|
@ -58,6 +58,14 @@ class TestMethodOverloading(TestCase):
|
|||
request = Request(factory.post('/', {api_settings.FORM_METHOD_OVERRIDE: 'DELETE'}))
|
||||
self.assertEqual(request.method, 'DELETE')
|
||||
|
||||
def test_x_http_method_override_header(self):
|
||||
"""
|
||||
POST requests can also be overloaded to another method by setting
|
||||
the X-HTTP-Method-Override header.
|
||||
"""
|
||||
request = Request(factory.post('/', {'foo': 'bar'}, HTTP_X_HTTP_METHOD_OVERRIDE='DELETE'))
|
||||
self.assertEqual(request.method, 'DELETE')
|
||||
|
||||
|
||||
class TestContentParsing(TestCase):
|
||||
def test_standard_behaviour_determines_no_content_GET(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user