diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2020-08-28 19:00:45 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2020-08-28 19:00:45 +0100 |
commit | fd835d20a02449c0d2a3c4c327696464df4937a1 (patch) | |
tree | f2017af14bd2a04458dd4b37ab7c300cbc4e4ee7 | |
parent | Convert confirmation from request args to HTML form data (diff) | |
download | synapse-anoa/halp.tar.xz |
Pass a list of arg tuples to urlencode instead of request.args github/anoa/halp anoa/halp
-rw-r--r-- | tests/rest/client/v2_alpha/test_account.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/rest/client/v2_alpha/test_account.py b/tests/rest/client/v2_alpha/test_account.py index 0223152295..4fdcda35c8 100644 --- a/tests/rest/client/v2_alpha/test_account.py +++ b/tests/rest/client/v2_alpha/test_account.py @@ -20,7 +20,6 @@ from urllib.parse import urlencode import os import re from email.parser import Parser -from tests.test_utils.http import convert_request_args_to_form_data import pkg_resources @@ -261,15 +260,23 @@ class PasswordResetTestCase(unittest.HomeserverTestCase): # Replace the path with the confirmation path path = "/_matrix/client/unstable/password_reset/email/submit_token_confirm" + form_args = [] + for key, value_list in request.args.items(): + for value in value_list: + arg = (key, value) + form_args.append(arg) + + print("form_args:", form_args) + print("encoded form_args:", urlencode(form_args)) + # Confirm the password reset request, channel = self.make_request( "POST", path, - content=urlencode(request.args).encode("utf8"), + content=urlencode(form_args).encode("utf8"), shorthand=False, ) self.render(request) - print(channel.json_body) self.assertEquals(200, channel.code, channel.result) def _get_link_from_email(self): |