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:
Danilo Bargen 2014-05-30 17:53:26 +02:00
parent a7ff51118f
commit 6cb6bfae1b

View File

@ -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`.'