From 20e416bdde78a90b7988ce48f3d00abd4e700e47 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 25 Jul 2024 22:27:55 +0200 Subject: [PATCH] fix tests Signed-off-by: Jens Langhammer --- tests/e2e/test_provider_ldap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/test_provider_ldap.py b/tests/e2e/test_provider_ldap.py index a750d1778299..af75a734f5be 100644 --- a/tests/e2e/test_provider_ldap.py +++ b/tests/e2e/test_provider_ldap.py @@ -5,6 +5,7 @@ from docker.client import DockerClient, from_env from docker.models.containers import Container +from guardian.shortcuts import assign_perm from ldap3 import ALL, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES, SUBTREE, Connection, Server from ldap3.core.exceptions import LDAPInvalidCredentialsResult @@ -54,9 +55,9 @@ def _prepare(self) -> User: ldap: LDAPProvider = LDAPProvider.objects.create( name=generate_id(), authorization_flow=Flow.objects.get(slug="default-authentication-flow"), - search_group=self.user.ak_groups.first(), search_mode=APIAccessMode.CACHED, ) + assign_perm("search_full_directory", self.user, ldap) # we need to create an application to actually access the ldap Application.objects.create(name=generate_id(), slug=generate_id(), provider=ldap) outpost: Outpost = Outpost.objects.create(