diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2020-11-05 14:55:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 13:55:45 +0000 |
commit | e4676bd8772275833857c803f8fe4025744cec01 (patch) | |
tree | fc51c24cf327979a294a74922ff2205e39ac9df6 /tests/unittest.py | |
parent | Consolidate purge table lists to prevent desyncronisation (#8713) (diff) | |
download | synapse-e4676bd8772275833857c803f8fe4025744cec01.tar.xz |
Add `displayname` to Shared-Secret Registration for admins (#8722)
Add `displayname` to Shared-Secret Registration for admins to `POST /_synapse/admin/v1/register`
Diffstat (limited to 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 19 |
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, |