mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:45:01 -04:00
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:
parent
01333681bc
commit
7eebe4b3fc
8 changed files with 22 additions and 22 deletions
|
@ -71,7 +71,7 @@ class FallbackAuthTests(unittest.HomeserverTestCase):
|
|||
"POST", "register", body
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
|
||||
self.assertEqual(request.code, expected_response)
|
||||
self.assertEqual(channel.code, expected_response)
|
||||
return channel
|
||||
|
||||
def recaptcha(
|
||||
|
@ -84,7 +84,7 @@ class FallbackAuthTests(unittest.HomeserverTestCase):
|
|||
request, channel = self.make_request(
|
||||
"GET", "auth/m.login.recaptcha/fallback/web?session=" + session
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
self.assertEqual(request.code, 200)
|
||||
self.assertEqual(channel.code, 200)
|
||||
|
||||
request, channel = self.make_request(
|
||||
"POST",
|
||||
|
@ -92,7 +92,7 @@ class FallbackAuthTests(unittest.HomeserverTestCase):
|
|||
+ post_session
|
||||
+ "&g-recaptcha-response=a",
|
||||
)
|
||||
self.assertEqual(request.code, expected_post_response)
|
||||
self.assertEqual(channel.code, expected_post_response)
|
||||
|
||||
# The recaptcha handler is called with the response given
|
||||
attempts = self.recaptcha_checker.recaptcha_attempts
|
||||
|
@ -201,7 +201,7 @@ class UIAuthTests(unittest.HomeserverTestCase):
|
|||
) # type: SynapseRequest, FakeChannel
|
||||
|
||||
# Ensure the response is sane.
|
||||
self.assertEqual(request.code, expected_response)
|
||||
self.assertEqual(channel.code, expected_response)
|
||||
|
||||
return channel
|
||||
|
||||
|
@ -214,7 +214,7 @@ class UIAuthTests(unittest.HomeserverTestCase):
|
|||
) # type: SynapseRequest, FakeChannel
|
||||
|
||||
# Ensure the response is sane.
|
||||
self.assertEqual(request.code, expected_response)
|
||||
self.assertEqual(channel.code, expected_response)
|
||||
|
||||
return channel
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue