tests: Add a test suite for maybe_enqueue_notifications.

This ensures that as we expand the logic for under what circumstances
email and push notifications should be sent, we can be confident about
this code path always doing the right thing.
This commit is contained in:
Tim Abbott
2017-09-27 11:27:04 -07:00
parent 830d3e8d07
commit 71fc8363b4
2 changed files with 91 additions and 0 deletions

View File

@@ -660,6 +660,9 @@ def maybe_enqueue_notifications(user_profile_id, message_id, private_message,
mentioned, stream_push_notify, stream_name,
always_push_notify, idle):
# type: (int, int, bool, bool, bool, Optional[str], bool, bool) -> Optional[Dict[str, bool]]
"""This function has a complete unit test suite in
`test_enqueue_notifications` that should be expanded as we add
more features here."""
notified = dict() # type: Dict[str, bool]
if (idle or always_push_notify) and (private_message or mentioned or stream_push_notify):