diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2020-08-21 11:00:53 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2020-08-21 11:41:56 +0100 |
commit | 6140b32397620da391dda9647eb54d533b4b2b5c (patch) | |
tree | c2521f489a12278cb5eee3d08dcbe1bf89d5cd84 | |
parent | Create new password reset confirmation endpoint (diff) | |
download | synapse-6140b32397620da391dda9647eb54d533b4b2b5c.tar.xz |
Add confirmation as a step to the password reset unit tests
-rw-r--r-- | tests/rest/client/v2_alpha/test_account.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rest/client/v2_alpha/test_account.py b/tests/rest/client/v2_alpha/test_account.py index 152a5182fa..f336671e2c 100644 --- a/tests/rest/client/v2_alpha/test_account.py +++ b/tests/rest/client/v2_alpha/test_account.py @@ -250,10 +250,23 @@ class PasswordResetTestCase(unittest.HomeserverTestCase): # Remove the host path = link.replace("https://example.com", "") + # Load the password reset confirmation page request, channel = self.make_request("GET", path, shorthand=False) self.render(request) self.assertEquals(200, channel.code, channel.result) + # Replace the path with the confirmation path + path = re.sub( + "^/_matrix.*submit_token", + "/_matrix/client/unstable/password_reset/email/submit_token_confirm", + path, + ) + + # Confirm the password reset + request, channel = self.make_request("POST", path, shorthand=False) + self.render(request) + self.assertEquals(200, channel.code, channel.result) + def _get_link_from_email(self): assert self.email_attempts, "No emails have been sent" |