Commit 6cb6bfae by Danilo Bargen

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.
parent a7ff5111
...@@ -36,7 +36,7 @@ class APIRequestFactory(DjangoRequestFactory): ...@@ -36,7 +36,7 @@ class APIRequestFactory(DjangoRequestFactory):
""" """
if not data: if not data:
return ('', None) return ('', content_type)
assert format is None or content_type is None, ( assert format is None or content_type is None, (
'You may not set both `format` and `content_type`.' 'You may not set both `format` and `content_type`.'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment