diff --git a/zerver/tests/test_narrow.py b/zerver/tests/test_narrow.py index 45f5a596cc..68ab0a495f 100644 --- a/zerver/tests/test_narrow.py +++ b/zerver/tests/test_narrow.py @@ -880,7 +880,7 @@ class GetOldMessagesTest(ZulipTestCase): ('meetings', 'please bring your laptops to take notes'), ('dinner', 'Anybody staying late tonight?'), ('urltest', 'https://google.com'), - (u'日本', u'こんにちは。今日はいい天気ですね。'), + (u'日本', u'こんに ちは 。 今日は いい 天気ですね。'), (u'日本', u'今朝はごはんを食べました。'), (u'日本', u'昨日、日本 のお菓子を送りました。'), ('english', u'I want to go to 日本!'), @@ -983,6 +983,21 @@ class GetOldMessagesTest(ZulipTestCase): english_message['match_content'], u'

I want to go to 日本!

') + # Multiple search operands with unicode + multi_search_narrow = [ + dict(operator='search', operand='ちは'), + dict(operator='search', operand='今日は'), + ] + multi_search_result = self.get_and_check_messages(dict( + narrow=ujson.dumps(multi_search_narrow), + anchor=next_message_id, + num_after=10, + num_before=0, + )) + self.assertEqual(len(multi_search_result['messages']), 1) + self.assertEqual(multi_search_result['messages'][0]['match_content'], + '

こんに ちは今日は いい 天気ですね。

') + @override_settings(USING_PGROONGA=False) def test_get_messages_with_search_not_subscribed(self): # type: () -> None @@ -1095,6 +1110,21 @@ class GetOldMessagesTest(ZulipTestCase): self.assertEqual(multi_search_result['messages'][0]['match_content'], '

Can you speak https://en.wikipedia.org/wiki/Japanese?

') + # Multiple search operands with unicode + multi_search_narrow = [ + dict(operator='search', operand='朝は'), + dict(operator='search', operand='べました'), + ] + multi_search_result = self.get_and_check_messages(dict( + narrow=ujson.dumps(multi_search_narrow), + anchor=next_message_id, + num_after=10, + num_before=0, + )) + self.assertEqual(len(multi_search_result['messages']), 1) + self.assertEqual(multi_search_result['messages'][0]['match_content'], + '

朝はごはんを食べました

') + narrow = [dict(operator='search', operand='https://google.com')] link_search_result = self.get_and_check_messages(dict( narrow=ujson.dumps(narrow),