Use parse_json_object_from_request to parse JSON out of request bodies

This commit is contained in:
Mark Haines 2016-03-11 16:41:03 +00:00
parent c081228439
commit e9c1cabac2
11 changed files with 49 additions and 90 deletions

View file

@ -95,7 +95,8 @@ class ProfileTestCase(unittest.TestCase):
mocked_set.side_effect = AuthError(400, "message")
(code, response) = yield self.mock_resource.trigger(
"PUT", "/profile/%s/displayname" % ("@4567:test"), '"Frank Jr."'
"PUT", "/profile/%s/displayname" % ("@4567:test"),
'{"displayname": "Frank Jr."}'
)
self.assertTrue(
@ -121,7 +122,8 @@ class ProfileTestCase(unittest.TestCase):
mocked_set.side_effect = SynapseError(400, "message")
(code, response) = yield self.mock_resource.trigger(
"PUT", "/profile/%s/displayname" % ("@opaque:elsewhere"), None
"PUT", "/profile/%s/displayname" % ("@opaque:elsewhere"),
'{"displayname":"bob"}'
)
self.assertTrue(