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:
Steve Howell
2020-03-06 17:40:46 +00:00
committed by Tim Abbott
parent c235333041
commit 1b16693526
55 changed files with 1071 additions and 1149 deletions

View File

@@ -256,7 +256,7 @@ class TestServiceBotStateHandler(ZulipTestCase):
def test_internal_endpoint(self):
# type: () -> None
self.login(self.user_profile.email)
self.login_user(self.user_profile)
# Store some data.
initial_dict = {'key 1': 'value 1', 'key 2': 'value 2', 'key 3': 'value 3'}