mirror of https://github.com/zulip/zulip.git
push notif tests: Use mock.patch instead of `apn.gcm = None`.
This is what it's for -- and it cleans up after itself, too.
This commit is contained in:
parent
ff12072f18
commit
e289c5835d
|
@ -1367,8 +1367,9 @@ class GCMSendTest(PushNotificationTest):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@mock.patch('zerver.lib.push_notifications.logger.debug')
|
@mock.patch('zerver.lib.push_notifications.logger.debug')
|
||||||
def test_gcm_is_none(self, mock_debug: mock.MagicMock) -> None:
|
@mock.patch('zerver.lib.push_notifications.gcm')
|
||||||
apn.gcm = None
|
def test_gcm_is_none(self, mock_gcm: mock.MagicMock, mock_debug: mock.MagicMock) -> None:
|
||||||
|
mock_gcm.__bool__.return_value = False
|
||||||
apn.send_android_push_notification_to_user(self.user_profile, {}, {})
|
apn.send_android_push_notification_to_user(self.user_profile, {}, {})
|
||||||
mock_debug.assert_called_with(
|
mock_debug.assert_called_with(
|
||||||
"Skipping sending a GCM push notification since PUSH_NOTIFICATION_BOUNCER_URL "
|
"Skipping sending a GCM push notification since PUSH_NOTIFICATION_BOUNCER_URL "
|
||||||
|
|
Loading…
Reference in New Issue