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.
This commit is contained in:
Hashir Sarwar 2020-06-09 03:01:41 +05:00 committed by Tim Abbott
parent a803e68528
commit 47ece353e6

View File

@ -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: