test_push_notifications: Sort pm_users list.

The production code sorts this list, so this test would fail
nondeterministically if the database returned these elements in
another order.
This commit is contained in:
Tim Abbott 2021-12-03 16:54:29 -08:00
parent cb2d0ff32b
commit eb3ad83560
1 changed files with 8 additions and 4 deletions

View File

@ -1622,8 +1622,10 @@ class TestGetAPNsPayload(PushNotificationTest):
"message_ids": [message.id],
"recipient_type": "private",
"pm_users": ",".join(
sorted(
str(s.user_profile_id)
for s in Subscription.objects.filter(recipient=message.recipient)
)
),
"sender_email": self.sender.email,
"sender_id": self.sender.id,
@ -1786,8 +1788,10 @@ class TestGetAPNsPayload(PushNotificationTest):
"message_ids": [message.id],
"recipient_type": "private",
"pm_users": ",".join(
sorted(
str(s.user_profile_id)
for s in Subscription.objects.filter(recipient=message.recipient)
)
),
"sender_email": self.sender.email,
"sender_id": self.sender.id,