push_notifications: Add num_push_devices_for_user tests.

This commit is contained in:
Umair Khan 2017-05-12 12:55:12 +05:00 committed by Tim Abbott
parent 88f5d29e19
commit fa5c66c439

View File

@ -632,6 +632,17 @@ class TestSendToPushBouncer(PushNotificationTest):
self.assertEqual(exc.exception.error,
'Error received from push notification bouncer')
class TestNumPushDevicesForUser(PushNotificationTest):
def test_when_kind_is_none(self):
# type: () -> None
self.assertEqual(apn.num_push_devices_for_user(self.user_profile), 2)
def test_when_kind_is_not_none(self):
# type: () -> None
count = apn.num_push_devices_for_user(self.user_profile,
kind=PushDeviceToken.APNS)
self.assertEqual(count, 2)
class TestPushApi(ZulipTestCase):
def test_push_api(self):
# type: () -> None