mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
push_notifications: Add num_push_devices_for_user tests.
This commit is contained in:
parent
88f5d29e19
commit
fa5c66c439
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user