mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 18:43:52 +00:00
email_notifications: Use assert to verify only one recipient.
This ValueError had no test coverage, because the code path wasn't actually possible with how the caller is constructed. Rather than writing a highly artificial test for this as proposed in
This commit is contained in:
@@ -377,10 +377,7 @@ def do_send_missedmessage_events_reply_in_zulip(
|
||||
recipients = {
|
||||
(msg["message"].recipient_id, msg["message"].topic_name()) for msg in missed_messages
|
||||
}
|
||||
if len(recipients) != 1:
|
||||
raise ValueError(
|
||||
f"All missed_messages must have the same recipient and topic {recipients!r}",
|
||||
)
|
||||
assert len(recipients) == 1, f"Unexpectedly multiple recipients: {recipients!r}"
|
||||
|
||||
# This link is no longer a part of the email, but keeping the code in case
|
||||
# we find a clean way to add it back in the future
|
||||
|
||||
Reference in New Issue
Block a user