mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
push_notifications: Remove unused num_push_devices_for_user function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
b2239e45ac
commit
fdbde9f9c2
@@ -417,13 +417,6 @@ def send_notifications_to_bouncer(
|
||||
#
|
||||
|
||||
|
||||
def num_push_devices_for_user(user_profile: UserProfile, kind: Optional[int] = None) -> int:
|
||||
if kind is None:
|
||||
return PushDeviceToken.objects.filter(user=user_profile).count()
|
||||
else:
|
||||
return PushDeviceToken.objects.filter(user=user_profile, kind=kind).count()
|
||||
|
||||
|
||||
def add_push_device_token(
|
||||
user_profile: UserProfile, token_str: str, kind: int, ios_app_id: Optional[str] = None
|
||||
) -> PushDeviceToken:
|
||||
|
||||
@@ -44,7 +44,6 @@ from zerver.lib.push_notifications import (
|
||||
handle_remove_push_notification,
|
||||
hex_to_b64,
|
||||
modernize_apns_payload,
|
||||
num_push_devices_for_user,
|
||||
parse_gcm_options,
|
||||
send_android_push_notification_to_user,
|
||||
send_apple_push_notification,
|
||||
@@ -1975,17 +1974,6 @@ class TestSendToPushBouncer(ZulipTestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestNumPushDevicesForUser(PushNotificationTest):
|
||||
def test_when_kind_is_none(self) -> None:
|
||||
self.setup_apns_tokens()
|
||||
self.assertEqual(num_push_devices_for_user(self.user_profile), 2)
|
||||
|
||||
def test_when_kind_is_not_none(self) -> None:
|
||||
self.setup_apns_tokens()
|
||||
count = num_push_devices_for_user(self.user_profile, kind=PushDeviceToken.APNS)
|
||||
self.assertEqual(count, 2)
|
||||
|
||||
|
||||
class TestPushApi(BouncerTestCase):
|
||||
@responses.activate
|
||||
def test_push_api_error_handling(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user