Skip to content

Commit

Permalink
Test RequestFactory with empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan P Kilby committed Aug 22, 2017
1 parent fed85bc commit eb88687
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_testing.py
Expand Up @@ -274,3 +274,12 @@ def test_request_factory_url_arguments_with_unicode(self):
assert dict(request.GET) == {'demo': ['testé']}
request = factory.get('/view/', {'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'

0 comments on commit eb88687

Please sign in to comment.