test_auth_backends: Move github_auth_enabled test to new suite.

This is step 1 of a migration to eventually delete the legacy test suite.
This commit is contained in:
Tim Abbott 2018-05-30 17:29:27 -07:00
parent 2aa8f214d4
commit 29492325a8
1 changed files with 4 additions and 4 deletions

View File

@ -576,6 +576,10 @@ class GitHubAuthBackendTest(ZulipTestCase):
user_profile = get_user(email, realm) user_profile = get_user(email, realm)
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id) self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
def test_github_auth_enabled(self) -> None:
with self.settings(AUTHENTICATION_BACKENDS=('zproject.backends.GitHubAuthBackend',)):
self.assertTrue(github_auth_enabled())
class GitHubAuthBackendLegacyTest(ZulipTestCase): class GitHubAuthBackendLegacyTest(ZulipTestCase):
def setUp(self) -> None: def setUp(self) -> None:
self.user_profile = self.example_user('hamlet') self.user_profile = self.example_user('hamlet')
@ -596,10 +600,6 @@ class GitHubAuthBackendLegacyTest(ZulipTestCase):
with self.settings(AUTHENTICATION_BACKENDS=('zproject.backends.GitHubAuthBackend',)): with self.settings(AUTHENTICATION_BACKENDS=('zproject.backends.GitHubAuthBackend',)):
return authenticate(**kwargs) return authenticate(**kwargs)
def test_github_auth_enabled(self) -> None:
with self.settings(AUTHENTICATION_BACKENDS=('zproject.backends.GitHubAuthBackend',)):
self.assertTrue(github_auth_enabled())
def test_full_name_with_missing_key(self) -> None: def test_full_name_with_missing_key(self) -> None:
self.assertEqual(self.backend.get_full_name(), '') self.assertEqual(self.backend.get_full_name(), '')
self.assertEqual(self.backend.get_full_name(response={'name': None}), '') self.assertEqual(self.backend.get_full_name(response={'name': None}), '')