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_unread: Change flag condition in get_mobile_push_notification_ids.

Hashir Sarwar47ece353e6d6
diff --git a/zerver/tests/test_unread.py b/zerver/tests/test_unread.py
index 803e1cf7393..2c66ed57546 100644
--- a/zerver/tests/test_unread.py
+++ b/zerver/tests/test_unread.py
@@ -458,8 +458,9 @@ class PushNotificationMarkReadFlowsTest(ZulipTestCase):
def get_mobile_push_notification_ids(self, user_profile: UserProfile) -> List[int]:
return list(UserMessage.objects.filter(
user_profile=user_profile,
- flags=UserMessage.flags.active_mobile_push_notification).order_by(
- "message_id").values_list("message_id", flat=True))
+ ).extra(
+ where=[UserMessage.where_active_push_notification()],
+ ).order_by("message_id").values_list("message_id", flat=True))
@mock.patch('zerver.lib.push_notifications.push_notifications_enabled', return_value=True)
def test_track_active_mobile_push_notifications(self, mock_push_notifications: mock.MagicMock) -> None: