Remove redundant reading of SynapseRequest.args

this didn't seem to be doing a lot, so remove it.
This commit is contained in:
Richard van der Hoff 2020-12-15 15:18:03 +00:00
parent 5bcf6e8289
commit ac2acf1524
1 changed files with 1 additions and 9 deletions

View File

@ -19,7 +19,6 @@ import os
import re import re
from email.parser import Parser from email.parser import Parser
from typing import Optional from typing import Optional
from urllib.parse import urlencode
import pkg_resources import pkg_resources
@ -268,20 +267,13 @@ class PasswordResetTestCase(unittest.HomeserverTestCase):
# Now POST to the same endpoint, mimicking the same behaviour as clicking the # Now POST to the same endpoint, mimicking the same behaviour as clicking the
# password reset confirm button # password reset confirm button
# Send arguments as url-encoded form data, matching the template's behaviour
form_args = []
for key, value_list in request.args.items():
for value in value_list:
arg = (key, value)
form_args.append(arg)
# Confirm the password reset # Confirm the password reset
request, channel = make_request( request, channel = make_request(
self.reactor, self.reactor,
FakeSite(self.submit_token_resource), FakeSite(self.submit_token_resource),
"POST", "POST",
path, path,
content=urlencode(form_args).encode("utf8"), content=b"",
shorthand=False, shorthand=False,
content_is_form=True, content_is_form=True,
) )