mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
tests: Limit email-based logins.
We now have this API...
If you really just need to log in
and not do anything with the actual
user:
self.login('hamlet')
If you're gonna use the user in the
rest of the test:
hamlet = self.example_user('hamlet')
self.login_user(hamlet)
If you are specifically testing
email/password logins (used only in 4 places):
self.login_by_email(email, password)
And for failures uses this (used twice):
self.assert_login_failure(email)
This commit is contained in:
@@ -74,8 +74,7 @@ class AdminNotifyHandlerTest(ZulipTestCase):
|
||||
handler.emit(record)
|
||||
|
||||
def simulate_error(self) -> logging.LogRecord:
|
||||
email = self.example_email('hamlet')
|
||||
self.login(email)
|
||||
self.login('hamlet')
|
||||
with patch("zerver.decorator.rate_limit") as rate_limit_patch:
|
||||
rate_limit_patch.side_effect = capture_and_throw
|
||||
result = self.client_get("/json/users")
|
||||
|
||||
Reference in New Issue
Block a user