models: Remove unused receives_stream_notifications function.

This was introduced in c3a8138f74, but
doesn't have any callers, apart from it's own tests.
This commit is contained in:
Abhijeet Prasad Bodas
2021-05-31 16:35:29 +05:30
committed by Tim Abbott
parent 518deb7b9e
commit 3990b183ce
2 changed files with 0 additions and 23 deletions

View File

@@ -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

View File

@@ -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: