summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-12-31 14:35:35 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-12-31 14:35:35 +0000
commit551681c29d2794f9aa2b7aa9109d55e4d7360194 (patch)
tree673d1411082d54427faf9e70b73ced01dfb44e49 /tests/unittest.py
parentMerge commit 'f27a78969' into anoa/dinsic_release_1_23_1 (diff)
parentAdd an admin API for users' media statistics (#8700) (diff)
downloadsynapse-551681c29d2794f9aa2b7aa9109d55e4d7360194.tar.xz
Merge commit 'c3119d153' into anoa/dinsic_release_1_23_1
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 08cf9b10c5..e36ac89196 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -546,18 +546,24 @@ class HomeserverTestCase(TestCase): return result - def register_user(self, username, password, admin=False): + def register_user( + self, + username: str, + password: str, + admin: Optional[bool] = False, + displayname: Optional[str] = None, + ) -> str: """ Register a user. Requires the Admin API be registered. Args: - username (bytes/unicode): The user part of the new user. - password (bytes/unicode): The password of the new user. - admin (bool): Whether the user should be created as an admin - or not. + username: The user part of the new user. + password: The password of the new user. + admin: Whether the user should be created as an admin or not. + displayname: The displayname of the new user. Returns: - The MXID of the new user (unicode). + The MXID of the new user. """ self.hs.config.registration_shared_secret = "shared" @@ -581,6 +587,7 @@ class HomeserverTestCase(TestCase): { "nonce": nonce, "username": username, + "displayname": displayname, "password": password, "admin": admin, "mac": want_mac,