From 1889e823092689d0b7f071a1ad373ebb4ff868b5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 21 Feb 2023 18:12:09 +0100 Subject: [PATCH] start fixing tests Signed-off-by: Jens Langhammer --- authentik/interfaces/api.py | 2 +- authentik/providers/oauth2/tests/test_device_init.py | 6 ++++-- tests/e2e/test_flows_authenticators.py | 6 +++--- tests/e2e/test_flows_login.py | 3 ++- tests/e2e/test_flows_stage_setup.py | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/authentik/interfaces/api.py b/authentik/interfaces/api.py index 6dc185e32..88134d084 100644 --- a/authentik/interfaces/api.py +++ b/authentik/interfaces/api.py @@ -1,8 +1,8 @@ """interfaces API""" from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import ModelViewSet -from authentik.core.api.used_by import UsedByMixin +from authentik.core.api.used_by import UsedByMixin from authentik.interfaces.models import Interface diff --git a/authentik/providers/oauth2/tests/test_device_init.py b/authentik/providers/oauth2/tests/test_device_init.py index 4e2a9e2bb..c16e12fbc 100644 --- a/authentik/providers/oauth2/tests/test_device_init.py +++ b/authentik/providers/oauth2/tests/test_device_init.py @@ -39,8 +39,9 @@ class TesOAuth2DeviceInit(OAuthTestCase): self.assertEqual( res.url, reverse( - "authentik_core:if-flow", + "authentik_interfaces:if", kwargs={ + "if_name": "flow", "flow_slug": self.device_flow.slug, }, ), @@ -68,8 +69,9 @@ class TesOAuth2DeviceInit(OAuthTestCase): self.assertEqual( res.url, reverse( - "authentik_core:if-flow", + "authentik_interfaces:if", kwargs={ + "if_name": "flow", "flow_slug": self.provider.authorization_flow.slug, }, ) diff --git a/tests/e2e/test_flows_authenticators.py b/tests/e2e/test_flows_authenticators.py index 100b489c9..a6aa0d328 100644 --- a/tests/e2e/test_flows_authenticators.py +++ b/tests/e2e/test_flows_authenticators.py @@ -33,7 +33,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): flow: Flow = Flow.objects.get(slug="default-authentication-flow") - self.driver.get(self.url("authentik_core:if-flow", flow_slug=flow.slug)) + self.driver.get(self.url("authentik_interfaces:if", if_name="flow", flow_slug=flow.slug)) self.login() # Get expected token @@ -57,7 +57,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): """test TOTP Setup stage""" flow: Flow = Flow.objects.get(slug="default-authentication-flow") - self.driver.get(self.url("authentik_core:if-flow", flow_slug=flow.slug)) + self.driver.get(self.url("authentik_interfaces:if", if_name="flow", flow_slug=flow.slug)) self.login() self.wait_for_url(self.if_user_url("/library")) @@ -103,7 +103,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): """test Static OTP Setup stage""" flow: Flow = Flow.objects.get(slug="default-authentication-flow") - self.driver.get(self.url("authentik_core:if-flow", flow_slug=flow.slug)) + self.driver.get(self.url("authentik_interfaces:if", if_name="flow", flow_slug=flow.slug)) self.login() self.wait_for_url(self.if_user_url("/library")) diff --git a/tests/e2e/test_flows_login.py b/tests/e2e/test_flows_login.py index aa477a519..edf399a2f 100644 --- a/tests/e2e/test_flows_login.py +++ b/tests/e2e/test_flows_login.py @@ -15,7 +15,8 @@ class TestFlowsLogin(SeleniumTestCase): """test default login flow""" self.driver.get( self.url( - "authentik_core:if-flow", + "authentik_interfaces:if", + if_name="flow", flow_slug="default-authentication-flow", ) ) diff --git a/tests/e2e/test_flows_stage_setup.py b/tests/e2e/test_flows_stage_setup.py index f0c791ffe..912cd21f3 100644 --- a/tests/e2e/test_flows_stage_setup.py +++ b/tests/e2e/test_flows_stage_setup.py @@ -35,7 +35,8 @@ class TestFlowsStageSetup(SeleniumTestCase): self.driver.get( self.url( - "authentik_core:if-flow", + "authentik_interfaces:if", + if_name="flow", flow_slug="default-authentication-flow", ) )