Replace request.code with channel.code

The two are equivalent, but really we want to check the HTTP result that got
returned to the channel, not the code that the Request object *intended* to
return to the channel.
This commit is contained in:
Richard van der Hoff 2020-12-15 14:51:25 +00:00
parent 01333681bc
commit 7eebe4b3fc
8 changed files with 22 additions and 22 deletions

View file

@ -353,7 +353,7 @@ class DeactivateTestCase(unittest.HomeserverTestCase):
# Check that this access token has been invalidated.
request, channel = self.make_request("GET", "account/whoami")
self.assertEqual(request.code, 401)
self.assertEqual(channel.code, 401)
def test_pending_invites(self):
"""Tests that deactivating a user rejects every pending invite for them."""
@ -410,7 +410,7 @@ class DeactivateTestCase(unittest.HomeserverTestCase):
request, channel = self.make_request(
"POST", "account/deactivate", request_data, access_token=tok
)
self.assertEqual(request.code, 200)
self.assertEqual(channel.code, 200)
class ThreepidEmailRestTestCase(unittest.HomeserverTestCase):