diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2022-07-17 23:28:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 22:28:45 +0100 |
commit | efee345b454ac5e6aeb4b4128793be1fbc308b91 (patch) | |
tree | f7e49ed0f8f3f3c65a01e60c79434cbc1b617cb2 /tests/test_terms_auth.py | |
parent | Make all `process_replication_rows` methods async (#13304) (diff) | |
download | synapse-efee345b454ac5e6aeb4b4128793be1fbc308b91.tar.xz |
Remove unnecessary `json.dumps` from tests (#13303)
Diffstat (limited to 'tests/test_terms_auth.py')
-rw-r--r-- | tests/test_terms_auth.py | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/tests/test_terms_auth.py b/tests/test_terms_auth.py index 37fada5c53..d3c13cf14c 100644 --- a/tests/test_terms_auth.py +++ b/tests/test_terms_auth.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json from unittest.mock import Mock from twisted.test.proto_helpers import MemoryReactorClock @@ -51,7 +50,7 @@ class TermsTestCase(unittest.HomeserverTestCase): def test_ui_auth(self): # Do a UI auth request - request_data = json.dumps({"username": "kermit", "password": "monkey"}) + request_data = {"username": "kermit", "password": "monkey"} channel = self.make_request(b"POST", self.url, request_data) self.assertEqual(channel.result["code"], b"401", channel.result) @@ -82,16 +81,14 @@ class TermsTestCase(unittest.HomeserverTestCase): self.assertDictContainsSubset(channel.json_body["params"], expected_params) # We have to complete the dummy auth stage before completing the terms stage - request_data = json.dumps( - { - "username": "kermit", - "password": "monkey", - "auth": { - "session": channel.json_body["session"], - "type": "m.login.dummy", - }, - } - ) + request_data = { + "username": "kermit", + "password": "monkey", + "auth": { + "session": channel.json_body["session"], + "type": "m.login.dummy", + }, + } self.registration_handler.check_username = Mock(return_value=True) @@ -102,16 +99,14 @@ class TermsTestCase(unittest.HomeserverTestCase): self.assertEqual(channel.result["code"], b"401", channel.result) # Finish the UI auth for terms - request_data = json.dumps( - { - "username": "kermit", - "password": "monkey", - "auth": { - "session": channel.json_body["session"], - "type": "m.login.terms", - }, - } - ) + request_data = { + "username": "kermit", + "password": "monkey", + "auth": { + "session": channel.json_body["session"], + "type": "m.login.terms", + }, + } channel = self.make_request(b"POST", self.url, request_data) # We're interested in getting a response that looks like a successful |