diff options
Diffstat (limited to 'tests/handlers/test_cas.py')
-rw-r--r-- | tests/handlers/test_cas.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/handlers/test_cas.py b/tests/handlers/test_cas.py index a54aa29cf1..751025c5da 100644 --- a/tests/handlers/test_cas.py +++ b/tests/handlers/test_cas.py @@ -201,4 +201,16 @@ class CasHandlerTestCase(HomeserverTestCase): def _mock_request(): """Returns a mock which will stand in as a SynapseRequest""" - return Mock(spec=["getClientIP", "getHeader", "_disconnected"]) + mock = Mock( + spec=[ + "finish", + "getClientIP", + "getHeader", + "setHeader", + "setResponseCode", + "write", + ] + ) + # `_disconnected` musn't be another `Mock`, otherwise it will be truthy. + mock._disconnected = False + return mock |