tests: Remove assert_streaming_content helper in favor of getvalue.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-06-15 16:07:40 -07:00
committed by Anders Kaseorg
parent 5901ffb0ab
commit 92c83c1df4
5 changed files with 22 additions and 34 deletions

View File

@@ -36,7 +36,6 @@ from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.state import StateApps
from django.db.utils import IntegrityError
from django.http import HttpRequest, HttpResponse
from django.http.response import StreamingHttpResponse
from django.test import TestCase
from django.test.client import BOUNDARY, MULTIPART_CONTENT, encode_multipart
from django.test.testcases import SerializeMixin
@@ -1111,11 +1110,6 @@ Output:
return [subscription.user_profile for subscription in subscriptions]
def assert_streaming_content(self, response: "TestHttpResponse", result: bytes) -> None:
assert isinstance(response, StreamingHttpResponse)
data = b"".join(response.streaming_content)
self.assertEqual(result, data)
def assert_json_success(
self,
result: Union["TestHttpResponse", HttpResponse],