-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚩 [#4246] Put new callback endpoint behind feature flag
- Loading branch information
1 parent
7f0ce3b
commit 59b5eb4
Showing
4 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
45 changes: 45 additions & 0 deletions
45
src/digid_eherkenning_oidc_generics/tests/test_callback_endpoints.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from django.test import SimpleTestCase, override_settings | ||
from django.urls import reverse | ||
|
||
from ..models import ( | ||
OpenIDConnectDigiDMachtigenConfig, | ||
OpenIDConnectEHerkenningBewindvoeringConfig, | ||
OpenIDConnectEHerkenningConfig, | ||
OpenIDConnectPublicConfig, | ||
) | ||
|
||
|
||
class CallbackEndpointTests(SimpleTestCase): | ||
|
||
@override_settings(USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS=True) | ||
def test_legacy_behaviour(self): | ||
expected = ( | ||
(OpenIDConnectPublicConfig, "/digid-oidc/callback/"), | ||
(OpenIDConnectEHerkenningConfig, "/eherkenning-oidc/callback/"), | ||
(OpenIDConnectDigiDMachtigenConfig, "/digid-machtigen-oidc/callback/"), | ||
( | ||
OpenIDConnectEHerkenningBewindvoeringConfig, | ||
"/eherkenning-bewindvoering-oidc/callback/", | ||
), | ||
) | ||
|
||
for config, expected_path in expected: | ||
with self.subTest(config=config): | ||
callback_path = reverse(config.oidc_authentication_callback_url) | ||
|
||
self.assertEqual(callback_path, expected_path) | ||
|
||
@override_settings(USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS=False) | ||
def test_new_behaviour(self): | ||
expected = ( | ||
OpenIDConnectPublicConfig, | ||
OpenIDConnectEHerkenningConfig, | ||
OpenIDConnectDigiDMachtigenConfig, | ||
OpenIDConnectEHerkenningBewindvoeringConfig, | ||
) | ||
|
||
for config in expected: | ||
with self.subTest(config=config): | ||
callback_path = reverse(config.oidc_authentication_callback_url) | ||
|
||
self.assertEqual(callback_path, "/auth/oidc/callback/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters