From 47ece353e6d6d019e781015ef923afaca028ffcf Mon Sep 17 00:00:00 2001 From: Hashir Sarwar Date: Tue, 9 Jun 2020 03:01:41 +0500 Subject: [PATCH] test_unread: Change flag condition in get_mobile_push_notification_ids. This uses `where_active_push_notification()` instead of the flag condition to keep it consistent with the app code as we use the same function to filter active push notifications everywhere else. --- zerver/tests/test_unread.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zerver/tests/test_unread.py b/zerver/tests/test_unread.py index 803e1cf739..2c66ed5754 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: