summary refs log tree commit diff
path: root/tests/handlers/test_register.py
diff options
context:
space:
mode:
authorReidAnderson <rbarryanderson@gmail.com>2019-05-20 05:20:08 -0500
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-05-20 11:20:08 +0100
commit3787133c9e3fcf0e9b85700418bf03c48ec86ab3 (patch)
tree5142e89481b5cb89354337cb2f70e0ad7a72842f /tests/handlers/test_register.py
parentfix mapping of return values for get_or_register_3pid_guest (#5177) (diff)
downloadsynapse-3787133c9e3fcf0e9b85700418bf03c48ec86ab3.tar.xz
Limit UserIds to a length that fits in a state key (#5198)
Diffstat (limited to 'tests/handlers/test_register.py')
-rw-r--r--tests/handlers/test_register.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index 1c253d0579..5ffba2ca7a 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -228,3 +228,10 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
     def test_register_not_support_user(self):
         res = self.get_success(self.handler.register(localpart='user'))
         self.assertFalse(self.store.is_support_user(res[0]))
+
+    def test_invalid_user_id_length(self):
+        invalid_user_id = "x" * 256
+        self.get_failure(
+            self.handler.register(localpart=invalid_user_id),
+            SynapseError
+        )