summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2023-02-20 12:00:18 +0000
committerGitHub <noreply@github.com>2023-02-20 12:00:18 +0000
commit1cbc3f197cc1b9732649ffb769b05d90c0e904d7 (patch)
treeab5ccdaf1cd2caac240bcc5370e6fa6c64b96bc8 /tests/handlers
parentBump types-setuptools from 67.1.0.0 to 67.3.0.1 (#15105) (diff)
downloadsynapse-1cbc3f197cc1b9732649ffb769b05d90c0e904d7.tar.xz
Fix a bug introduced in Synapse v1.74.0 where searching with colons when using ICU for search term tokenisation would fail with an error. (#15079)
Co-authored-by: David Robertson <davidr@element.io>
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_user_directory.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/handlers/test_user_directory.py b/tests/handlers/test_user_directory.py
index f65a68b9c2..a02c1c6227 100644
--- a/tests/handlers/test_user_directory.py
+++ b/tests/handlers/test_user_directory.py
@@ -192,6 +192,13 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
         self.helper.join(room, self.appservice.sender, tok=self.appservice.token)
         self._check_only_one_user_in_directory(user, room)
 
+    def test_search_term_with_colon_in_it_does_not_raise(self) -> None:
+        """
+        Regression test: Test that search terms with colons in them are acceptable.
+        """
+        u1 = self.register_user("user1", "pass")
+        self.get_success(self.handler.search_users(u1, "haha:paamayim-nekudotayim", 10))
+
     def test_user_not_in_users_table(self) -> None:
         """Unclear how it happens, but on matrix.org we've seen join events
         for users who aren't in the users table. Test that we don't fall over