summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-07-11 12:21:00 -0400
committerGitHub <noreply@github.com>2023-07-11 12:21:00 -0400
commita4243183f0b500f9f30f2d24af19f30a99f65f63 (patch)
treef3590f5a33f30f814452f70377a8f1352d02898a /tests
parentDon't build wheels for Python 3.7 (#15917) (diff)
downloadsynapse-a4243183f0b500f9f30f2d24af19f30a99f65f63.tar.xz
Add + as an allowed character for Matrix IDs (MSC4009) (#15911)
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_register.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index 8d8584609b..54eeec228e 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -587,17 +587,16 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
         self.assertFalse(self.get_success(d))
 
     def test_invalid_user_id(self) -> None:
-        invalid_user_id = "+abcd"
+        invalid_user_id = "^abcd"
         self.get_failure(
             self.handler.register_user(localpart=invalid_user_id), SynapseError
         )
 
-    @override_config({"experimental_features": {"msc4009_e164_mxids": True}})
-    def text_extended_user_ids(self) -> None:
-        """+ should be allowed according to MSC4009."""
-        valid_user_id = "+1234"
+    def test_special_chars(self) -> None:
+        """Ensure that characters which are allowed in Matrix IDs work."""
+        valid_user_id = "a1234_-./=+"
         user_id = self.get_success(self.handler.register_user(localpart=valid_user_id))
-        self.assertEqual(user_id, valid_user_id)
+        self.assertEqual(user_id, f"@{valid_user_id}:test")
 
     def test_invalid_user_id_length(self) -> None:
         invalid_user_id = "x" * 256