diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-08-09 12:22:01 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 12:22:01 +1000 |
commit | 2511f3f8a082585e680dad200069dec77b066a6a (patch) | |
tree | 90212ffc4a723c50a537a3b1865d6468bebf431b /tests/rest/client/v1/test_admin.py | |
parent | Merge pull request #3664 from matrix-org/rav/federation_metrics (diff) | |
download | synapse-2511f3f8a082585e680dad200069dec77b066a6a.tar.xz |
Test fixes for Python 3 (#3647)
Diffstat (limited to 'tests/rest/client/v1/test_admin.py')
-rw-r--r-- | tests/rest/client/v1/test_admin.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/rest/client/v1/test_admin.py b/tests/rest/client/v1/test_admin.py index 8c90145601..fb28883d30 100644 --- a/tests/rest/client/v1/test_admin.py +++ b/tests/rest/client/v1/test_admin.py @@ -140,7 +140,7 @@ class UserRegisterTestCase(unittest.TestCase): "admin": True, "mac": want_mac, } - ).encode('utf8') + ) request, channel = make_request("POST", self.url, body.encode('utf8')) render(request, self.resource, self.clock) @@ -168,7 +168,7 @@ class UserRegisterTestCase(unittest.TestCase): "admin": True, "mac": want_mac, } - ).encode('utf8') + ) request, channel = make_request("POST", self.url, body.encode('utf8')) render(request, self.resource, self.clock) @@ -195,7 +195,7 @@ class UserRegisterTestCase(unittest.TestCase): "admin": True, "mac": want_mac, } - ).encode('utf8') + ) request, channel = make_request("POST", self.url, body.encode('utf8')) render(request, self.resource, self.clock) @@ -253,7 +253,7 @@ class UserRegisterTestCase(unittest.TestCase): self.assertEqual('Invalid username', channel.json_body["error"]) # Must not have null bytes - body = json.dumps({"nonce": nonce(), "username": b"abcd\x00"}) + body = json.dumps({"nonce": nonce(), "username": u"abcd\u0000"}) request, channel = make_request("POST", self.url, body.encode('utf8')) render(request, self.resource, self.clock) @@ -289,7 +289,7 @@ class UserRegisterTestCase(unittest.TestCase): self.assertEqual('Invalid password', channel.json_body["error"]) # Must not have null bytes - body = json.dumps({"nonce": nonce(), "username": "a", "password": b"abcd\x00"}) + body = json.dumps({"nonce": nonce(), "username": "a", "password": u"abcd\u0000"}) request, channel = make_request("POST", self.url, body.encode('utf8')) render(request, self.resource, self.clock) |