From 1cbe87c07702703c331d10fba8a61e7cac078042 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Thu, 7 Dec 2023 10:31:16 +0100 Subject: [PATCH] fix remaining failing tests Signed-off-by: Marc 'risson' Schmitt --- authentik/providers/scim/tests/test_user.py | 4 ++++ authentik/tenants/api.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/authentik/providers/scim/tests/test_user.py b/authentik/providers/scim/tests/test_user.py index 36377b925..6a6960ea6 100644 --- a/authentik/providers/scim/tests/test_user.py +++ b/authentik/providers/scim/tests/test_user.py @@ -11,6 +11,7 @@ from authentik.core.models import Application, Group, User from authentik.lib.generators import generate_id from authentik.providers.scim.models import SCIMMapping, SCIMProvider from authentik.providers.scim.tasks import scim_sync +from authentik.tenants.utils import get_current_tenant class SCIMUserTests(TestCase): @@ -20,6 +21,9 @@ class SCIMUserTests(TestCase): def setUp(self) -> None: # Delete all users and groups as the mocked HTTP responses only return one ID # which will cause errors with multiple users + tenant = get_current_tenant() + tenant.avatars = "none" + tenant.save() User.objects.all().exclude(pk=get_anonymous_user().pk).delete() Group.objects.all().delete() self.provider: SCIMProvider = SCIMProvider.objects.create( diff --git a/authentik/tenants/api.py b/authentik/tenants/api.py index 98ed9d11a..890d46e27 100644 --- a/authentik/tenants/api.py +++ b/authentik/tenants/api.py @@ -57,6 +57,7 @@ class TenantViewSet(ModelViewSet): authentication_classes = [] permission_classes = [TenantApiKeyPermission] filter_backends = [OrderingFilter, SearchFilter] + filterset_fields = [] def dispatch(self, request, *args, **kwargs): if not CONFIG.get_bool("tenants.enabled", True): @@ -86,6 +87,7 @@ class DomainViewSet(ModelViewSet): authentication_classes = [] permission_classes = [TenantApiKeyPermission] filter_backends = [OrderingFilter, SearchFilter] + filterset_fields = [] def dispatch(self, request, *args, **kwargs): if not CONFIG.get_bool("tenants.enabled", True):