mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
push notifications: Remove tests for get_alert_from_message.
The string that is returned from get_alert_from_message is dependent upon the same message that is passed into get_apns_payload and get_gcm_payload. The contents of those payloads that are tested via TestGetAPNsPayload and TestGetGCMPayload, which makes the tests for get_alert_from_message redundant. Also, simplify the logic by removing the last elif conditional.
This commit is contained in:
@@ -440,11 +440,8 @@ def get_alert_from_message(message: Message) -> str:
|
||||
return "New private message from %s" % (sender_str,)
|
||||
elif message.is_stream_message() and message.trigger == 'mentioned':
|
||||
return "New mention from %s" % (sender_str,)
|
||||
elif (message.is_stream_message() and
|
||||
(message.trigger == 'stream_push_notify' and message.stream_name)):
|
||||
else: # message.is_stream_message() and message.trigger == 'stream_push_notify'
|
||||
return "New stream message from %s in %s" % (sender_str, message.stream_name,)
|
||||
else:
|
||||
return "New Zulip mentions and private messages from %s" % (sender_str,)
|
||||
|
||||
def get_mobile_push_content(rendered_content: str) -> str:
|
||||
def get_text(elem: LH.HtmlElement) -> str:
|
||||
|
||||
Reference in New Issue
Block a user