From 3990b183ceb6dd420c2e36c31f1e118c18c6e231 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Bodas Date: Mon, 31 May 2021 16:35:29 +0530 Subject: [PATCH] models: Remove unused `receives_stream_notifications` function. This was introduced in c3a8138f749042a11d1e3b7d3384781dbce12481, but doesn't have any callers, apart from it's own tests. --- zerver/models.py | 4 ---- zerver/tests/test_push_notifications.py | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/zerver/models.py b/zerver/models.py index 338954b3b2..46e73f6590 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -1665,10 +1665,6 @@ def receives_online_push_notifications(user_profile: UserProfile) -> bool: return user_profile.enable_online_push_notifications and not user_profile.is_bot -def receives_stream_notifications(user_profile: UserProfile) -> bool: - return user_profile.enable_stream_push_notifications and not user_profile.is_bot - - def remote_user_to_email(remote_user: str) -> str: if settings.SSO_APPEND_DOMAIN is not None: remote_user += "@" + settings.SSO_APPEND_DOMAIN diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index 2e45148a78..eaca359e8e 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -73,7 +73,6 @@ from zerver.models import ( receives_offline_email_notifications, receives_offline_push_notifications, receives_online_push_notifications, - receives_stream_notifications, ) if settings.ZILENCER_ENABLED: @@ -2257,24 +2256,6 @@ class TestReceivesNotificationsFunctions(ZulipTestCase): self.assertTrue(receives_offline_push_notifications(self.user)) self.assertFalse(receives_offline_email_notifications(self.user)) - def test_receivers_stream_notifications_when_user_is_a_bot(self) -> None: - self.user.is_bot = True - - self.user.enable_stream_push_notifications = True - self.assertFalse(receives_stream_notifications(self.user)) - - self.user.enable_stream_push_notifications = False - self.assertFalse(receives_stream_notifications(self.user)) - - def test_receivers_stream_notifications_when_user_is_not_a_bot(self) -> None: - self.user.is_bot = False - - self.user.enable_stream_push_notifications = True - self.assertTrue(receives_stream_notifications(self.user)) - - self.user.enable_stream_push_notifications = False - self.assertFalse(receives_stream_notifications(self.user)) - class TestPushNotificationsContent(ZulipTestCase): def test_fixtures(self) -> None: