mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #7581 -- Added streaming responses.
Thanks mrmachine and everyone else involved on this long-standing ticket.
This commit is contained in:
@@ -596,7 +596,9 @@ class TransactionTestCase(SimpleTestCase):
|
||||
msg_prefix + "Couldn't retrieve content: Response code was %d"
|
||||
" (expected %d)" % (response.status_code, status_code))
|
||||
text = force_text(text, encoding=response._charset)
|
||||
content = response.content.decode(response._charset)
|
||||
content = b''.join(response).decode(response._charset)
|
||||
# Avoid ResourceWarning about unclosed files.
|
||||
response.close()
|
||||
if html:
|
||||
content = assert_and_parse_html(self, content, None,
|
||||
"Response's content is not valid HTML:")
|
||||
|
||||
Reference in New Issue
Block a user