Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_import_export: Tighten function signatures with generic QuerySet.

Zixuan James Li5a934ef39fc4
diff --git a/zerver/tests/test_import_export.py b/zerver/tests/test_import_export.py
index 35a63616868..f40f6e4b69f 100644
--- a/zerver/tests/test_import_export.py
+++ b/zerver/tests/test_import_export.py
@@ -7,6 +7,7 @@ from unittest.mock import patch
import orjson
from django.conf import settings
from django.db.models import Q
+from django.db.models.query import QuerySet
from django.utils.timezone import now as timezone_now
from analytics.models import UserCount
@@ -1078,7 +1079,7 @@ class RealmImportExportTest(ExportFile):
return {"key": bot_config_data.key, "data": bot_config_data.value}
# test messages
- def get_stream_messages(r: Realm) -> Message:
+ def get_stream_messages(r: Realm) -> QuerySet[Message]:
recipient = get_recipient_stream(r)
messages = Message.objects.filter(recipient=recipient)
return messages