diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js index e49c1993eb..184f93320a 100644 --- a/frontend_tests/node_tests/composebox_typeahead.js +++ b/frontend_tests/node_tests/composebox_typeahead.js @@ -213,7 +213,7 @@ const othello = { const cordelia = { email: "cordelia@zulip.com", user_id: 102, - full_name: "Cordelia Lear", + full_name: "Cordelia, Lear's daughter", }; const deactivated_user = { email: "other@zulip.com", @@ -763,7 +763,7 @@ test("initialize", (override) => { // Adds a `no break-space` at the end. This should fail // if there wasn't any logic replacing `no break-space` // with normal space. - query = "cordelia" + String.fromCharCode(160); + query = "cordelia, lear's" + String.fromCharCode(160); assert.equal(matcher(query, cordelia), true); assert.equal(matcher(query, othello), false); @@ -783,7 +783,7 @@ test("initialize", (override) => { options.query = "othello@zulip.com, cor"; actual_value = options.updater(cordelia, event); - assert.equal(appended_name, "Cordelia Lear"); + assert.equal(appended_name, "Cordelia, Lear's daughter"); const click_event = {type: "click", target: "#doesnotmatter"}; options.query = "othello"; @@ -1468,8 +1468,8 @@ test("typeahead_results", () => { assert_emoji_matches("notaemoji", []); // Autocomplete user mentions by user name. assert_mentions_matches("cordelia", [cordelia]); - assert_mentions_matches("cordelia le", [cordelia]); - assert_mentions_matches("cordelia le ", []); + assert_mentions_matches("cordelia, le", [cordelia]); + assert_mentions_matches("cordelia, le ", []); assert_mentions_matches("King ", [hamlet, lear]); assert_mentions_matches("King H", [hamlet]); assert_mentions_matches("King L", [lear]); diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index 0cb28fb5ac..ab8535c62f 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -58,7 +58,7 @@ emoji.initialize(emoji_params); fenced_code.initialize(pygments_data); const cordelia = { - full_name: "Cordelia Lear", + full_name: "Cordelia, Lear's daughter", user_id: 101, email: "cordelia@zulip.com", }; @@ -266,7 +266,7 @@ test("message_flags", () => { assert(!message.mentioned); assert(!message.mentioned_me_directly); - message = {raw_content: "@**Cordelia Lear**"}; + message = {raw_content: "@**Cordelia, Lear's daughter**"}; markdown.apply_markdown(message); assert(message.mentioned); assert(message.mentioned_me_directly); @@ -326,9 +326,9 @@ test("marked", () => { expected: "
\n\nquote this for me
\n
thanks
", }, { - input: "This is a @**CordeLIA Lear** mention", + input: "This is a @**CordeLIA, Lear's daughter** mention", expected: - 'This is a @Cordelia Lear mention
', + 'This is a @Cordelia, Lear's daughter mention
', }, { input: "These @ @**** are not mentions", @@ -387,15 +387,15 @@ test("marked", () => { ':poop:
', }, { - input: "Silent mention: @_**Cordelia Lear**", + input: "Silent mention: @_**Cordelia, Lear's daughter**", expected: - 'Silent mention: Cordelia Lear
', + 'Silent mention: Cordelia, Lear's daughter
', }, { input: - "> Mention in quote: @**Cordelia Lear**\n\nMention outside quote: @**Cordelia Lear**", + "> Mention in quote: @**Cordelia, Lear's daughter**\n\nMention outside quote: @**Cordelia, Lear's daughter**", expected: - '\n\nMention in quote: Cordelia Lear
\n
Mention outside quote: @Cordelia Lear
', + '\n\nMention in quote: Cordelia, Lear's daughter
\n
Mention outside quote: @Cordelia, Lear's daughter
', }, // Test only those linkifiers which don't return True for // `contains_backend_only_syntax()`. Those which return True @@ -422,9 +422,9 @@ test("marked", () => { 'T
\n#Denmark
T
\n@Cordelia Lear
T
\n@Cordelia, Lear's daughter
@**Invalid User|1234**
"}, { - input: "@**Cordelia LeAR|103** has a wrong user_id.", - expected: "@**Cordelia LeAR|103** has a wrong user_id.
", + input: "@**Cordelia, Lear's daughter|103** has a wrong user_id.", + expected: "@**Cordelia, Lear's daughter|103** has a wrong user_id.
", }, { input: "@**Brother of Bobby|123** is really the full name.", @@ -642,7 +642,7 @@ test("message_flags", () => { assert.equal(message.is_me_message, true); - input = "testing this @**all** @**Cordelia Lear**"; + input = "testing this @**all** @**Cordelia, Lear's daughter**"; message = {topic: "No links here", raw_content: input}; markdown.apply_markdown(message); diff --git a/frontend_tests/puppeteer_lib/common.ts b/frontend_tests/puppeteer_lib/common.ts index 6fc5c1515b..a13929063a 100644 --- a/frontend_tests/puppeteer_lib/common.ts +++ b/frontend_tests/puppeteer_lib/common.ts @@ -50,7 +50,7 @@ class CommonUtils { }; fullname: Record\n" @@ -1987,7 +1987,7 @@ class MarkdownTest(ZulipTestCase): "
" f'@King Hamlet' " and " - f'@Cordelia Lear' + f'@Cordelia, Lear\'s daughter' "
", ) self.assertEqual(msg.mentions_user_ids, {hamlet.id, cordelia.id}) @@ -2028,9 +2028,7 @@ class MarkdownTest(ZulipTestCase): cordelia = self.example_user("cordelia") msg = Message(sender=sender_user_profile, sending_client=get_client("test")) - content = ( - f"@**Mark Twin|{twin1.id}**, @**Mark Twin|{twin2.id}** and @**Cordelia Lear**, hi." - ) + content = f"@**Mark Twin|{twin1.id}**, @**Mark Twin|{twin2.id}** and @**Cordelia, Lear's daughter**, hi." self.assertEqual( render_markdown(msg, content), @@ -2040,7 +2038,7 @@ class MarkdownTest(ZulipTestCase): '@Mark Twin and ' '@Cordelia Lear, ' + f'data-user-id="{cordelia.id}">@Cordelia, Lear\'s daughter, ' "hi.", ) self.assertEqual(msg.mentions_user_ids, {twin1.id, twin2.id, cordelia.id}) @@ -2180,7 +2178,7 @@ class MarkdownTest(ZulipTestCase): assert_mentions("smush@*steve*smush", set()) assert_mentions( - "@*support* Hello @**King Hamlet** and @**Cordelia Lear**\n" + "@*support* Hello @**King Hamlet** and @**Cordelia, Lear's daughter**\n" "@**Foo van Barson** @**all**", {"support"}, ) diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py index fdccd3ce05..e155c50b17 100644 --- a/zerver/tests/test_message_edit.py +++ b/zerver/tests/test_message_edit.py @@ -439,7 +439,9 @@ class EditMessageTest(ZulipTestCase): self.subscribe(hamlet, "Scotland") self.subscribe(cordelia, "Scotland") - msg_id = self.send_stream_message(hamlet, "Scotland", content="@**Cordelia Lear**") + msg_id = self.send_stream_message( + hamlet, "Scotland", content="@**Cordelia, Lear's daughter**" + ) user_info = get_user_info_for_message_updates(msg_id) message_user_ids = user_info["message_user_ids"] diff --git a/zerver/tests/test_message_edit_notifications.py b/zerver/tests/test_message_edit_notifications.py index 56f9159c8b..98b765013e 100644 --- a/zerver/tests/test_message_edit_notifications.py +++ b/zerver/tests/test_message_edit_notifications.py @@ -40,7 +40,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): self._assert_update_does_not_notify_anybody( message_id=message_id, - content="now we mention @**Cordelia Lear**", + content="now we mention @**Cordelia, Lear's daughter**", ) def _login_and_send_original_stream_message( @@ -177,7 +177,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): def test_updates_with_stream_mention(self) -> None: original_content = "no mention" - updated_content = "now we mention @**Cordelia Lear**" + updated_content = "now we mention @**Cordelia, Lear's daughter**" notification_message_data = self._send_and_update_message(original_content, updated_content) message_id = notification_message_data["message_id"] @@ -217,8 +217,8 @@ class EditMessageSideEffectsTest(ZulipTestCase): self.assertEqual(email_event["trigger"], "mentioned") def test_second_mention_is_ignored(self) -> None: - original_content = "hello @**Cordelia Lear**" - updated_content = "re-mention @**Cordelia Lear**" + original_content = "hello @**Cordelia, Lear's daughter**" + updated_content = "re-mention @**Cordelia, Lear's daughter**" self._send_and_update_message(original_content, updated_content, expect_short_circuit=True) def _turn_on_stream_push_for_cordelia(self) -> None: @@ -305,7 +305,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): # Simulate Cordelia is FULLY present, not just in term of # browser activity, but also in terms of her client descriptors. original_content = "no mention" - updated_content = "newly mention @**Cordelia Lear**" + updated_content = "newly mention @**Cordelia, Lear's daughter**" notification_message_data = self._send_and_update_message( original_content, updated_content, @@ -385,7 +385,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): # but they don't have UserPresence rows, so we will still # send offline notifications. original_content = "no mention" - updated_content = "now we mention @**Cordelia Lear**" + updated_content = "now we mention @**Cordelia, Lear's daughter**" notification_message_data = self._send_and_update_message( original_content, updated_content, @@ -453,7 +453,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): # If there was a previous wildcard mention delivered to the # user (because wildcard_mention_notify=True), we don't notify original_content = "Mention @**all**" - updated_content = "now we mention @**Cordelia Lear**" + updated_content = "now we mention @**Cordelia, Lear's daughter**" self._send_and_update_message( original_content, updated_content, expect_short_circuit=True, connected_to_zulip=True ) @@ -470,7 +470,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): cordelia.save() original_content = "Mention @**all**" - updated_content = "now we mention @**Cordelia Lear**" + updated_content = "now we mention @**Cordelia, Lear's daughter**" self._send_and_update_message( original_content, updated_content, expect_short_circuit=True, connected_to_zulip=True ) @@ -481,7 +481,7 @@ class EditMessageSideEffectsTest(ZulipTestCase): # Simulate Cordelia is FULLY present, not just in term of # browser activity, but also in terms of her client descriptors. original_content = "no mention" - updated_content = "now we mention @**Cordelia Lear**" + updated_content = "now we mention @**Cordelia, Lear's daughter**" notification_message_data = self._send_and_update_message( original_content, updated_content, diff --git a/zerver/tests/test_message_send.py b/zerver/tests/test_message_send.py index 62b97be8e3..e35cc7ff86 100644 --- a/zerver/tests/test_message_send.py +++ b/zerver/tests/test_message_send.py @@ -1642,7 +1642,7 @@ class StreamMessagesTest(ZulipTestCase): ).delete() def mention_cordelia() -> Set[int]: - content = "test @**Cordelia Lear** rules" + content = "test @**Cordelia, Lear's daughter** rules" user_ids = self._send_stream_message( user=hamlet, diff --git a/zerver/tests/test_new_users.py b/zerver/tests/test_new_users.py index 25fb08a51d..43d1483ab5 100644 --- a/zerver/tests/test_new_users.py +++ b/zerver/tests/test_new_users.py @@ -249,5 +249,6 @@ class TestNotifyNewUser(ZulipTestCase): actual_stream = Stream.objects.get(id=message.recipient.type_id) self.assertEqual(actual_stream.name, Realm.INITIAL_PRIVATE_STREAM_NAME) self.assertIn( - f"@_**Cordelia Lear|{new_user.id}** just signed up for Zulip.", message.content + f"@_**Cordelia, Lear's daughter|{new_user.id}** just signed up for Zulip.", + message.content, ) diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index ca06aa604c..adc1fad7e5 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -1490,7 +1490,7 @@ class TestGetAPNsPayload(PushNotificationTest): payload = get_message_payload_apns(user_profile, message) expected = { "alert": { - "title": "Cordelia Lear, King Hamlet, Othello, the Moor of Venice", + "title": "Cordelia, Lear's daughter, King Hamlet, Othello, the Moor of Venice", "subtitle": "King Hamlet:", "body": message.content, }, @@ -1622,7 +1622,7 @@ class TestGetAPNsPayload(PushNotificationTest): payload = get_message_payload_apns(user_profile, message) expected = { "alert": { - "title": "Cordelia Lear, King Hamlet, Othello, the Moor of Venice", + "title": "Cordelia, Lear's daughter, King Hamlet, Othello, the Moor of Venice", "subtitle": "King Hamlet:", "body": "***REDACTED***", }, @@ -2298,8 +2298,8 @@ class TestPushNotificationsContent(ZulipTestCase): }, { "name": "mentions", - "rendered_content": f'Mentioning @Cordelia Lear.
', - "expected_output": "Mentioning @Cordelia Lear.", + "rendered_content": f'Mentioning @Cordelia, Lear\'s daughter.
', + "expected_output": "Mentioning @Cordelia, Lear's daughter.", }, { "name": "stream_names", diff --git a/zerver/tests/test_soft_deactivation.py b/zerver/tests/test_soft_deactivation.py index a936123cf6..02fb0f7d44 100644 --- a/zerver/tests/test_soft_deactivation.py +++ b/zerver/tests/test_soft_deactivation.py @@ -671,7 +671,7 @@ class SoftDeactivationMessageTest(ZulipTestCase): # anyone is mentioned but the user. general_user_msg_count = len(get_user_messages(cordelia)) soft_deactivated_user_msg_count = len(get_user_messages(long_term_idle_user)) - message = "Test @**Cordelia Lear** mention" + message = "Test @**Cordelia, Lear's daughter** mention" send_stream_message(message) assert_last_um_content(long_term_idle_user, message, negate=True) assert_um_count(long_term_idle_user, soft_deactivated_user_msg_count) diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.py index e6815d9467..30f1b2dc57 100644 --- a/zerver/tests/test_users.py +++ b/zerver/tests/test_users.py @@ -1221,8 +1221,8 @@ class UserProfileTest(ZulipTestCase): self.assertEqual(len(events), 0) # We verify that cordelia and iago match, but hamlet has the defaults. - self.assertEqual(iago.full_name, "Cordelia Lear") - self.assertEqual(cordelia.full_name, "Cordelia Lear") + self.assertEqual(iago.full_name, "Cordelia, Lear's daughter") + self.assertEqual(cordelia.full_name, "Cordelia, Lear's daughter") self.assertEqual(hamlet.full_name, "King Hamlet") self.assertEqual(iago.default_language, "de") diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json index 8d6243de05..c7bfb2a9ae 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json @@ -19,7 +19,7 @@ "assignee":{ "type":"admin", "id":"1957471", - "name":"Cordelia Lear", + "name":"Cordelia, Lear's daughter", "email":"cordelia@zulip.com" }, "conversation_message":{ diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json b/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json index 2151c8e01d..443fda2366 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json @@ -19,7 +19,7 @@ "assignee": { "type": "admin", "id": "1957471", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "cordelia@zulip.com" }, "conversation_message": { diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json b/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json index d6d307f88a..0060eb9aef 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json @@ -12,7 +12,7 @@ "type": "lead", "id": "5c96b58c27e3772c4751b2a3", "user_id": "ced6189f-e3b0-40b6-ab3a-9fdb27f4b3b0", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "eg3800@mun.ca", "do_not_track": null }, diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json b/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json index 2b5be57cb3..9944b8fa13 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json @@ -19,7 +19,7 @@ "assignee":{ "type": "admin", "id": "1957471", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "cordelia@zulip.com" }, "conversation_message":{ diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json b/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json index 07697b8ee9..9613cd8543 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json @@ -19,7 +19,7 @@ "assignee": { "type": "admin", "id": "1957471", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "cordelia@zulip.com" }, "conversation_message": { diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json index 9be003e855..78c9978160 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json @@ -19,7 +19,7 @@ "assignee": { "type": "admin", "id": "1957471", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "cordelia@zulip.com" }, "conversation_message": { diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json index e2f0f56d6b..3c3e026861 100644 --- a/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json +++ b/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json @@ -19,7 +19,7 @@ "assignee": { "type": "admin", "id": "1957471", - "name": "Cordelia Lear", + "name": "Cordelia, Lear's daughter", "email": "cordelia@zulip.com" }, "conversation_message": { diff --git a/zerver/webhooks/intercom/tests.py b/zerver/webhooks/intercom/tests.py index b444e71e49..6e126d5ceb 100644 --- a/zerver/webhooks/intercom/tests.py +++ b/zerver/webhooks/intercom/tests.py @@ -93,7 +93,7 @@ Contact signed up: ) def test_conversation_admin_opened(self) -> None: - expected_topic = "Lead: Cordelia Lear" + expected_topic = "Lead: Cordelia, Lear's daughter" expected_message = "Eeshan Garg opened the conversation." self.check_webhook( "conversation_admin_opened", @@ -103,7 +103,7 @@ Contact signed up: def test_conversation_admin_closed(self) -> None: expected_topic = "Lead: Eeshan Garg" - expected_message = "Cordelia Lear closed the conversation." + expected_message = "Cordelia, Lear's daughter closed the conversation." self.check_webhook( "conversation_admin_closed", expected_topic, @@ -112,7 +112,7 @@ Contact signed up: def test_conversation_admin_snoozed(self) -> None: expected_topic = "Lead: Eeshan Garg" - expected_message = "Cordelia Lear snoozed the conversation." + expected_message = "Cordelia, Lear's daughter snoozed the conversation." self.check_webhook( "conversation_admin_snoozed", expected_topic, @@ -121,7 +121,7 @@ Contact signed up: def test_conversation_admin_unsnoozed(self) -> None: expected_topic = "Lead: Eeshan Garg" - expected_message = "Cordelia Lear unsnoozed the conversation." + expected_message = "Cordelia, Lear's daughter unsnoozed the conversation." self.check_webhook( "conversation_admin_unsnoozed", expected_topic, @@ -131,7 +131,7 @@ Contact signed up: def test_conversation_admin_replied(self) -> None: expected_topic = "Lead: Eeshan Garg" expected_message = """ -Cordelia Lear replied to the conversation: +Cordelia, Lear's daughter replied to the conversation: ``` quote Hey Eeshan! How can I help? @@ -146,7 +146,7 @@ Hey Eeshan! How can I help? def test_conversation_admin_noted(self) -> None: expected_topic = "Lead: Eeshan Garg" expected_message = """ -Cordelia Lear added a note to the conversation: +Cordelia, Lear's daughter added a note to the conversation: ``` quote Talk to Tim about this user's query. @@ -161,7 +161,7 @@ Talk to Tim about this user's query. def test_conversation_admin_single_created(self) -> None: expected_topic = "Lead: Eeshan Garg" expected_message = """ -Cordelia Lear initiated a conversation: +Cordelia, Lear's daughter initiated a conversation: ``` quote Hi Eeshan, What's up diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index aa85973bdf..f4c0193819 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -344,7 +344,7 @@ class Command(BaseCommand): ("Othello, the Moor of Venice", "othello@zulip.com"), ("Iago", "iago@zulip.com"), ("Prospero from The Tempest", "prospero@zulip.com"), - ("Cordelia Lear", "cordelia@zulip.com"), + ("Cordelia, Lear's daughter", "cordelia@zulip.com"), ("King Hamlet", "hamlet@zulip.com"), ("aaron", "AARON@zulip.com"), ("Polonius", "polonius@zulip.com"), @@ -746,7 +746,7 @@ class Command(BaseCommand): testsuite_lear_users = [ ("King Lear", "king@lear.org"), - ("Cordelia Lear", "cordelia@zulip.com"), + ("Cordelia, Lear's daughter", "cordelia@zulip.com"), ] create_users(lear_realm, testsuite_lear_users, tos_version=settings.TOS_VERSION)