push_notifications: Add test for APNs payload.

This commit is contained in:
Umair Khan 2017-05-11 12:26:00 +05:00 committed by Tim Abbott
parent 47d0f7d996
commit 136a950041
1 changed files with 11 additions and 0 deletions

View File

@ -380,6 +380,17 @@ class TestGetAlertFromMessage(PushNotificationTest):
"New Zulip mentions and private messages from King " "New Zulip mentions and private messages from King "
"Hamlet") "Hamlet")
class TestGetAPNsPayload(PushNotificationTest):
def test_get_apns_payload(self):
# type: () -> None
message = self.get_message(Recipient.HUDDLE)
payload = apn.get_apns_payload(message)
expected = {
"alert": "New private group message from King Hamlet",
"message_ids": [message.id],
}
self.assertDictEqual(payload, expected)
class TestPushApi(ZulipTestCase): class TestPushApi(ZulipTestCase):
def test_push_api(self): def test_push_api(self):
# type: () -> None # type: () -> None