Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message-send: Update translated errors for stream to channel rename.
Lauryn Menardc1f1dc4b2584
diff --git a/zerver/actions/message_send.py b/zerver/actions/message_send.pyindex e2b0260c6af..89736db589d 100644--- a/zerver/actions/message_send.py+++ b/zerver/actions/message_send.py@@ -1260,7 +1260,7 @@ def extract_stream_indicator(s: str) -> Union[str, int]:# once we improve our documentation.if isinstance(data, list):if len(data) != 1: # nocoverage- raise JsonableError(_("Expected exactly one stream"))+ raise JsonableError(_("Expected exactly one channel"))data = data[0]if isinstance(data, str):@@ -1271,7 +1271,7 @@ def extract_stream_indicator(s: str) -> Union[str, int]:# We had a stream id.return data- raise JsonableError(_("Invalid data type for stream"))+ raise JsonableError(_("Invalid data type for channel"))def extract_private_recipients(s: str) -> Union[List[str], List[int]]:@@ -1463,8 +1463,8 @@ def send_pm_if_empty_stream("channel_id": stream_id,}content = _(- "Your bot {bot_identity} tried to send a message to stream ID "- "{channel_id}, but there is no stream with that ID."+ "Your bot {bot_identity} tried to send a message to channel ID "+ "{channel_id}, but there is no channel with that ID.").format(**arg_dict)else:assert stream_name is not None@@ -1474,8 +1474,8 @@ def send_pm_if_empty_stream("new_channel_link": "#streams/new",}content = _(- "Your bot {bot_identity} tried to send a message to stream "- "{channel_name}, but that stream does not exist. "+ "Your bot {bot_identity} tried to send a message to channel "+ "{channel_name}, but that channel does not exist. ""Click [here]({new_channel_link}) to create it.").format(**arg_dict)else:@@ -1487,7 +1487,7 @@ def send_pm_if_empty_stream(}content = _("Your bot {bot_identity} tried to send a message to "- "stream {channel_name}. The stream exists but "+ "channel {channel_name}. The channel exists but ""does not have any subscribers.").format(**arg_dict)diff --git a/zerver/tests/test_message_send.py b/zerver/tests/test_message_send.pyindex 242fc61ee81..24ace182410 100644--- a/zerver/tests/test_message_send.py+++ b/zerver/tests/test_message_send.py@@ -140,7 +140,7 @@ class MessagePOSTTest(ZulipTestCase):msg = self.get_last_message()expected = ("Your bot `[email protected]` tried to send a message to "- "stream ID 99999, but there is no stream with that ID."+ "channel ID 99999, but there is no channel with that ID.")self.assertEqual(msg.content, expected)@@ -175,7 +175,7 @@ class MessagePOSTTest(ZulipTestCase):msg = self.get_second_to_last_message()expected = ("Your bot `[email protected]` tried to send a message to "- "stream #**Acropolis**. The stream exists but does not have any subscribers."+ "channel #**Acropolis**. The channel exists but does not have any subscribers.")self.assertEqual(msg.content, expected)@@ -210,7 +210,7 @@ class MessagePOSTTest(ZulipTestCase):msg = self.get_second_to_last_message()expected = ("Your bot `[email protected]` tried to send a message to "- "stream #**Acropolis**. The stream exists but does not have any subscribers."+ "channel #**Acropolis**. The channel exists but does not have any subscribers.")self.assertEqual(msg.content, expected)@@ -2428,13 +2428,13 @@ class ExtractTest(ZulipTestCase):123,)- with self.assertRaisesRegex(JsonableError, "Invalid data type for stream"):+ with self.assertRaisesRegex(JsonableError, "Invalid data type for channel"):extract_stream_indicator("{}")- with self.assertRaisesRegex(JsonableError, "Invalid data type for stream"):+ with self.assertRaisesRegex(JsonableError, "Invalid data type for channel"):extract_stream_indicator("[{}]")- with self.assertRaisesRegex(JsonableError, "Expected exactly one stream"):+ with self.assertRaisesRegex(JsonableError, "Expected exactly one channel"):extract_stream_indicator('[1,2,"general"]')def test_extract_private_recipients_emails(self) -> None:@@ -3053,7 +3053,7 @@ class CheckMessageTest(ZulipTestCase):new_count = message_stream_count(parent)self.assertEqual(new_count, old_count + 1)- self.assertIn("that stream does not exist.", most_recent_message(parent).content)+ self.assertIn("that channel does not exist.", most_recent_message(parent).content)# Try sending to stream that exists with no subscribers soon# after; due to rate-limiting, this should send nothing.diff --git a/zerver/tests/test_outgoing_webhook_system.py b/zerver/tests/test_outgoing_webhook_system.pyindex 2a9620e4dd9..233ff9c0418 100644--- a/zerver/tests/test_outgoing_webhook_system.py+++ b/zerver/tests/test_outgoing_webhook_system.py@@ -635,7 +635,7 @@ class TestOutgoingWebhookMessaging(ZulipTestCase):prev_message = self.get_second_to_last_message()self.assertIn(- "tried to send a message to stream #**Denmark**, but that stream does not exist",+ "tried to send a message to channel #**Denmark**, but that channel does not exist",prev_message.content,)diff --git a/zerver/webhooks/helloworld/tests.py b/zerver/webhooks/helloworld/tests.pyindex 0ec9f0327a7..071c7f1eadc 100644--- a/zerver/webhooks/helloworld/tests.py+++ b/zerver/webhooks/helloworld/tests.py@@ -54,7 +54,7 @@ class HelloWorldHookTests(WebhookTestCase):self.url = self.build_webhook_url()realm = get_realm("zulip")notification_bot = get_system_bot(settings.NOTIFICATION_BOT, realm.id)- expected_message = "Your bot `[email protected]` tried to send a message to stream #**nonexistent**, but that stream does not exist. Click [here](#streams/new) to create it."+ expected_message = "Your bot `[email protected]` tried to send a message to channel #**nonexistent**, but that channel does not exist. Click [here](#streams/new) to create it."self.send_and_test_private_message("goodbye",expected_message=expected_message,