Not include charset when charset is None

This commit is contained in:
Minjae Kim 2020-07-07 15:27:22 +09:00 committed by GitHub
parent 36bd1b30d8
commit 01428f72db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,8 +179,10 @@ class APIRequestFactory(DjangoRequestFactory):
ret = renderer.render(data)
# Determine the content-type header from the renderer
content_type = renderer.media_type
if renderer.charset:
content_type = "{}; charset={}".format(
renderer.media_type, renderer.charset
content_type, renderer.charset
)
# Coerce text to bytes if required.