mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:56:02 -04:00
Remove unnecessary json.dumps
from tests (#13303)
This commit is contained in:
parent
5d4028f217
commit
efee345b45
13 changed files with 143 additions and 200 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue