Skip to content

Commit eb88687

Browse files
author
Ryan P Kilby
committed
Test RequestFactory with empty body
1 parent fed85bc commit eb88687

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_testing.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,12 @@ def test_request_factory_url_arguments_with_unicode(self):
274274
assert dict(request.GET) == {'demo': ['testé']}
275275
request = factory.get('/view/', {'demo': 'testé'})
276276
assert dict(request.GET) == {'demo': ['testé']}
277+
278+
def test_empty_request_content_type(self):
279+
factory = APIRequestFactory()
280+
request = factory.post(
281+
'/post-view/',
282+
data=None,
283+
content_type='application/json',
284+
)
285+
assert request.content_type == 'application/json'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy