Unicode content in test response

17 views
Skip to first unread message

Torsten Bronger

unread,
Jul 27, 2015, 5:58:04 AM7/27/15
to django...@googlegroups.com
Hallöchen!

When writing unit tests, the response's content is a byte string.
If I need a unicode string, I can write

response.decode(reponse.charset)

However, the "charset" attribute is not documented in
<https://docs.djangoproject.com/en/dev/topics/testing/tools/#testing-responses>.
Is this an oversight? (In
<https://docs.djangoproject.com/en/1.8/ref/template-response/#id1>,
it is mentioned.)

Is there a better way to get a unicode response?

Tschö,
Torsten.

--
Torsten Bronger Jabber ID: torsten...@jabber.rwth-aachen.de

Reply all
Reply to author
Forward
0 new messages