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:
Jack Zhang
2018-10-04 20:08:54 -07:00
committed by Tim Abbott
parent e2ee455314
commit 92a100798c
2 changed files with 2 additions and 40 deletions

View File

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