tests: Test directly for stream name.

This commit is contained in:
Steve Howell 2023-07-16 11:09:25 +00:00 committed by Tim Abbott
parent 7c864db8f2
commit df068ae7a5
1 changed files with 8 additions and 9 deletions

View File

@ -74,7 +74,6 @@ from zerver.models import (
UserMessage, UserMessage,
UserTopic, UserTopic,
get_client, get_client,
get_display_recipient,
get_realm, get_realm,
get_stream, get_stream,
get_user_profile_by_id, get_user_profile_by_id,
@ -2048,7 +2047,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2079,7 +2078,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2115,7 +2114,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2152,7 +2151,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2185,7 +2184,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2218,7 +2217,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2251,7 +2250,7 @@ class TestGetAPNsPayload(PushNotificationTest):
"recipient_type": "stream", "recipient_type": "stream",
"sender_email": self.sender.email, "sender_email": self.sender.email,
"sender_id": self.sender.id, "sender_id": self.sender.id,
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
"server": settings.EXTERNAL_HOST, "server": settings.EXTERNAL_HOST,
@ -2339,7 +2338,7 @@ class TestGetGCMPayload(PushNotificationTest):
"sender_full_name": "King Hamlet", "sender_full_name": "King Hamlet",
"sender_avatar_url": absolute_avatar_url(message.sender), "sender_avatar_url": absolute_avatar_url(message.sender),
"recipient_type": "stream", "recipient_type": "stream",
"stream": get_display_recipient(message.recipient), "stream": stream.name,
"stream_id": stream.id, "stream_id": stream.id,
"topic": message.topic_name(), "topic": message.topic_name(),
} }