1
0
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:
Aymeric Augustin
2012-10-20 17:40:14 +02:00
parent 300d052713
commit 4b27813198
18 changed files with 533 additions and 75 deletions

View File

@@ -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:")