mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-07 07:03:12 +03:00
Test RequestFactory with empty body
This commit is contained in:
parent
fed85bc29d
commit
eb88687e28
|
@ -274,3 +274,12 @@ class TestAPIRequestFactory(TestCase):
|
||||||
assert dict(request.GET) == {'demo': ['testé']}
|
assert dict(request.GET) == {'demo': ['testé']}
|
||||||
request = factory.get('/view/', {'demo': 'testé'})
|
request = factory.get('/view/', {'demo': 'testé'})
|
||||||
assert dict(request.GET) == {'demo': ['testé']}
|
assert dict(request.GET) == {'demo': ['testé']}
|
||||||
|
|
||||||
|
def test_empty_request_content_type(self):
|
||||||
|
factory = APIRequestFactory()
|
||||||
|
request = factory.post(
|
||||||
|
'/post-view/',
|
||||||
|
data=None,
|
||||||
|
content_type='application/json',
|
||||||
|
)
|
||||||
|
assert request.content_type == 'application/json'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user