test: Use example_user() in more places.

This commit replaces calls to get_user_profile_by_email() with
calls to self.example_user() by introducing a local variable.
This commit is contained in:
Steve Howell
2017-05-08 07:23:43 -07:00
committed by Tim Abbott
parent 7f9057ba99
commit 3a031f6814
4 changed files with 27 additions and 18 deletions

View File

@@ -381,8 +381,9 @@ class AuthBackendTest(ZulipTestCase):
@override_settings(AUTHENTICATION_BACKENDS=('zproject.backends.GitHubAuthBackend',))
def test_github_backend(self):
# type: () -> None
email = 'hamlet@zulip.com'
self.setup_subdomain(get_user_profile_by_email(email))
user = self.example_user('hamlet')
email = user.email
self.setup_subdomain(user)
good_kwargs = dict(response=dict(email=email), return_data=dict(),
realm_subdomain='acme')
self.verify_backend(GitHubAuthBackend(),