Fix's bug that does not allow an Oauth2 provider to have different slug and backend_names

Added comment to explain model change.

Removed accidental whitespace.

Another pip issue.
This commit is contained in:
Thomas Tracy
2019-03-28 14:06:10 -04:00
parent faab3e954a
commit f59dc6c820
3 changed files with 21 additions and 6 deletions

View File

@@ -159,6 +159,14 @@ class RegistryTest(testutil.TestCase):
self.assertIn(google_provider, provider.Registry._enabled_providers())
self.assertIn(google_provider, provider.Registry.get_enabled_by_backend_name('google-oauth2'))
def test_oath2_different_slug_from_backend_name(self):
"""
Test that an OAuth2 provider can have a slug that differs from the backend name.
"""
dummy_provider = self.configure_oauth_provider(enabled=True, name="dummy", slug="default", backend_name="dummy")
self.assertIn(dummy_provider, provider.Registry._enabled_providers())
self.assertIn(dummy_provider, provider.Registry.get_enabled_by_backend_name('dummy'))
def test_oauth2_enabled_only_for_supplied_backend(self):
"""
Test to ensure that Registry.get_enabled_by_backend_name doesn't return OAuth2 providers with incorrect