mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
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:
committed by
Tim Abbott
parent
e7c62c4190
commit
5d54cd1041
@@ -574,8 +574,11 @@ Output:
|
|||||||
|
|
||||||
def assert_login_failure(self, email: str, password: str) -> None:
|
def assert_login_failure(self, email: str, password: str) -> None:
|
||||||
realm = get_realm("zulip")
|
realm = get_realm("zulip")
|
||||||
|
request = HttpRequest()
|
||||||
|
request.session = self.client.session
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
self.client.login(
|
self.client.login(
|
||||||
|
request=request,
|
||||||
username=email,
|
username=email,
|
||||||
password=password,
|
password=password,
|
||||||
realm=realm,
|
realm=realm,
|
||||||
|
|||||||
Reference in New Issue
Block a user