diff --git a/authentik/core/tests/utils.py b/authentik/core/tests/utils.py index bd67ee909..051667ec7 100644 --- a/authentik/core/tests/utils.py +++ b/authentik/core/tests/utils.py @@ -22,7 +22,7 @@ def create_test_flow(designation: FlowDesignation = FlowDesignation.STAGE_CONFIG ) -def create_test_admin_user(name: Optional[str] = None) -> User: +def create_test_admin_user(name: Optional[str] = None, set_password = False) -> User: """Generate a test-admin user""" uid = generate_id(20) if not name else name group = Group.objects.create(name=uid, is_superuser=True) @@ -31,7 +31,8 @@ def create_test_admin_user(name: Optional[str] = None) -> User: name=uid, email=f"{uid}@goauthentik.io", ) - user.set_password(uid) + if set_password: + user.set_password(uid) group.users.add(user) return user diff --git a/tests/e2e/test_provider_ldap.py b/tests/e2e/test_provider_ldap.py index 63c5b8b77..2206ab7f2 100644 --- a/tests/e2e/test_provider_ldap.py +++ b/tests/e2e/test_provider_ldap.py @@ -49,7 +49,7 @@ class TestProviderLDAP(SeleniumTestCase): def _prepare(self) -> User: """prepare user, provider, app and container""" # set additionalHeaders to test later - user = create_test_admin_user() + user = create_test_admin_user(set_password=True) user.attributes["extraAttribute"] = "bar" user.save()