fix remaining failing tests

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt 2023-12-07 10:31:16 +01:00
parent 526cadcd09
commit 1cbe87c077
No known key found for this signature in database
GPG Key ID: 9C3FA22FABF1AA8D
2 changed files with 6 additions and 0 deletions

View File

@ -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(

View File

@ -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):