mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
a6775bc61e
* re-instate previously flaky test Signed-off-by: Jens Langhammer <jens@goauthentik.io> * break up big file Signed-off-by: Jens Langhammer <jens@goauthentik.io> * move geoip data to subdir Signed-off-by: Jens Langhammer <jens@goauthentik.io> * i am but a weak man Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix ldap disconnect in testing Signed-off-by: Jens Langhammer <jens@goauthentik.io> * account for mismatched uid due to test server process Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
"""test default login flow"""
|
|
|
|
from authentik.blueprints.tests import apply_blueprint
|
|
from authentik.flows.models import Flow
|
|
from tests.decorators import retry
|
|
from tests.selenium import SeleniumTestCase
|
|
|
|
|
|
class TestFlowsLogin(SeleniumTestCase):
|
|
"""test default login flow"""
|
|
|
|
def tearDown(self):
|
|
# Reset authentication flow's compatibility mode; we need to do this as its
|
|
# not specified in the blueprint
|
|
Flow.objects.filter(slug="default-authentication-flow").update(compatibility_mode=False)
|
|
return super().tearDown()
|
|
|
|
@retry()
|
|
@apply_blueprint(
|
|
"default/flow-default-authentication-flow.yaml",
|
|
"default/flow-default-invalidation-flow.yaml",
|
|
)
|
|
def test_login(self):
|
|
"""test default login flow"""
|
|
self.driver.get(
|
|
self.url(
|
|
"authentik_core:if-flow",
|
|
flow_slug="default-authentication-flow",
|
|
)
|
|
)
|
|
self.login()
|
|
self.wait_for_url(self.if_user_url("/library"))
|
|
self.assert_user(self.user)
|
|
|
|
@retry()
|
|
@apply_blueprint(
|
|
"default/flow-default-authentication-flow.yaml",
|
|
"default/flow-default-invalidation-flow.yaml",
|
|
)
|
|
def test_login_compatibility_mode(self):
|
|
"""test default login flow with compatibility mode enabled"""
|
|
Flow.objects.filter(slug="default-authentication-flow").update(compatibility_mode=True)
|
|
self.driver.get(
|
|
self.url(
|
|
"authentik_core:if-flow",
|
|
flow_slug="default-authentication-flow",
|
|
)
|
|
)
|
|
self.login(shadow_dom=False)
|
|
self.wait_for_url(self.if_user_url("/library"))
|
|
self.assert_user(self.user)
|