tests: Use a HttpRequest object in assert_login_failure.

Our convention is to always have authenticate() called with a request
object. We need to be consistent with that in tests too, to avoid test
failures resulting from breaking that assumption.
We modify assert_login_failure to call client.login() in the same way as
the other similar helpers - with a properly initialized HttpRequest
instance.
This commit is contained in:
Mateusz Mandera
2021-09-01 20:08:56 +02:00
committed by Tim Abbott
parent e7c62c4190
commit 5d54cd1041

View File

@@ -574,8 +574,11 @@ Output:
def assert_login_failure(self, email: str, password: str) -> None:
realm = get_realm("zulip")
request = HttpRequest()
request.session = self.client.session
self.assertFalse(
self.client.login(
request=request,
username=email,
password=password,
realm=realm,