diff --git a/social_core/backends/checkin.py b/social_core/backends/checkin.py index dcff5244d..845e6a976 100644 --- a/social_core/backends/checkin.py +++ b/social_core/backends/checkin.py @@ -64,9 +64,7 @@ def get_user_details(self, response): def entitlement_allowed(self, user_entitlements): allowed = True - allowed_ent = self.setting( - "ALLOWED_ENTITLEMENTS", self.ALLOWED_ENTITLEMENTS - ) + allowed_ent = self.setting("ALLOWED_ENTITLEMENTS", self.ALLOWED_ENTITLEMENTS) if allowed_ent: allowed = any(e in user_entitlements for e in allowed_ent) return allowed diff --git a/social_core/tests/backends/test_checkin.py b/social_core/tests/backends/test_checkin.py index 31eb794a8..11366618f 100644 --- a/social_core/tests/backends/test_checkin.py +++ b/social_core/tests/backends/test_checkin.py @@ -3,6 +3,7 @@ from .oauth import OAuth2Test from .test_open_id_connect import OpenIdConnectTestMixin + class CheckinOpenIdConnectTest(OpenIdConnectTestMixin, OAuth2Test): backend_path = "social_core.backends.checkin.CheckinOpenIdConnect" issuer = "https://aai.egi.eu/auth/realms/egi" @@ -298,18 +299,21 @@ class CheckinOpenIdConnectTest(OpenIdConnectTestMixin, OAuth2Test): ) def test_checkin_env_prod(self): - self.assertEqual(self.backend.oidc_endpoint(), - "https://aai.egi.eu/auth/realms/egi") + self.assertEqual( + self.backend.oidc_endpoint(), "https://aai.egi.eu/auth/realms/egi" + ) def test_checkin_env_demo(self): self.backend.CHECKIN_ENV = "demo" - self.assertEqual(self.backend.oidc_endpoint(), - "https://aai-demo.egi.eu/auth/realms/egi") - + self.assertEqual( + self.backend.oidc_endpoint(), "https://aai-demo.egi.eu/auth/realms/egi" + ) + def test_checkin_env_dev(self): self.backend.CHECKIN_ENV = "dev" - self.assertEqual(self.backend.oidc_endpoint(), - "https://aai-dev.egi.eu/auth/realms/egi") + self.assertEqual( + self.backend.oidc_endpoint(), "https://aai-dev.egi.eu/auth/realms/egi" + ) def test_entitlements_empty(self): self.assertEqual(self.backend.entitlement_allowed([]), True)