Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

mentions: Update backend tests to not use only "stream" wildcard.

Lauryn Menard92f236ffeaf9
diff --git a/zerver/tests/test_message_notification_emails.py b/zerver/tests/test_message_notification_emails.py
index 0fb10c9928a..c2467d073ff 100644
--- a/zerver/tests/test_message_notification_emails.py
+++ b/zerver/tests/test_message_notification_emails.py
@@ -791,7 +791,7 @@ class TestMessageNotificationEmails(ZulipTestCase):
othello = self.example_user("othello")
stream_wildcard_mentioned_in_followed_topic_message_id = self.send_stream_message(
- othello, "Denmark", "@**stream**"
+ othello, "Denmark", "@**all**"
)
topic_wildcard_mentioned_in_followed_topic_message_id = self.send_stream_message(
othello, "Denmark", "@**topic**"
@@ -810,7 +810,7 @@ class TestMessageNotificationEmails(ZulipTestCase):
)
expected_email_include = [
- "Othello, the Moor of Venice: > @**stream** > @**topic** -- ",
+ "Othello, the Moor of Venice: > @**all** > @**topic** -- ",
"You are receiving this because all topic participants were mentioned in #Denmark > test.",
]
diff --git a/zerver/tests/test_soft_deactivation.py b/zerver/tests/test_soft_deactivation.py
index 0b0a44118ef..f86c1636e83 100644
--- a/zerver/tests/test_soft_deactivation.py
+++ b/zerver/tests/test_soft_deactivation.py
@@ -4,6 +4,7 @@ from unittest import mock
from django.utils.timezone import now as timezone_now
from zerver.actions.alert_words import do_add_alert_words
+from zerver.lib.mention import stream_wildcards
from zerver.lib.soft_deactivation import (
add_missing_messages,
do_auto_soft_deactivate_users,
@@ -747,15 +748,10 @@ class SoftDeactivationMessageTest(ZulipTestCase):
# Test UserMessage row is created while user is deactivated if
# there is a stream wildcard mention such as @all or @everyone
- assert_stream_message_sent_to_idle_user(
- "Test @**all** mention", possible_stream_wildcard_mention=True
- )
- assert_stream_message_sent_to_idle_user(
- "Test @**everyone** mention", possible_stream_wildcard_mention=True
- )
- assert_stream_message_sent_to_idle_user(
- "Test @**stream** mention", possible_stream_wildcard_mention=True
- )
+ for stream_wildcard in stream_wildcards:
+ assert_stream_message_sent_to_idle_user(
+ f"Test @**{stream_wildcard}** mention", possible_stream_wildcard_mention=True
+ )
assert_stream_message_not_sent_to_idle_user("Test @**bogus** mention")
# Test UserMessage row is created while user is deactivated if