1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[4.2.x] Refs #34342 -- Added tests for handling sync streaming responses by test client.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>

Backport of bfb8fda3e6 from main
This commit is contained in:
Alexandre Spaeth
2023-02-17 10:35:19 +01:00
committed by Mariusz Felisiak
parent e1c74bf458
commit 1ecbc04624
3 changed files with 22 additions and 4 deletions

View File

@@ -253,7 +253,7 @@ class AdminActionsTest(TestCase):
response = self.client.post(
reverse("admin:admin_views_externalsubscriber_changelist"), action_data
)
content = b"".join(response.streaming_content)
content = b"".join(list(response))
self.assertEqual(content, b"This is the content of the file")
self.assertEqual(response.status_code, 200)