mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Always use specified content type in APIRequestFactory
If `content_type` is specified in the `APIRequestFactory`, always include it in the request, even if data is empty.
This commit is contained in:
parent
a7ff51118f
commit
6cb6bfae1b
|
@ -36,7 +36,7 @@ class APIRequestFactory(DjangoRequestFactory):
|
|||
"""
|
||||
|
||||
if not data:
|
||||
return ('', None)
|
||||
return ('', content_type)
|
||||
|
||||
assert format is None or content_type is None, (
|
||||
'You may not set both `format` and `content_type`.'
|
||||
|
|
Loading…
Reference in New Issue
Block a user