From 687a7e0c166554617ce9f6a794a255e22507f387 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Fri, 12 Jan 2024 02:33:55 +0100 Subject: [PATCH] recovery tests: do them on a new tenant Signed-off-by: Marc 'risson' Schmitt --- authentik/tenants/tests/test_recovery.py | 7 +++++-- scripts/create_bucket.sh | 0 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/create_bucket.sh diff --git a/authentik/tenants/tests/test_recovery.py b/authentik/tenants/tests/test_recovery.py index 3570e9d48..ddee18360 100644 --- a/authentik/tenants/tests/test_recovery.py +++ b/authentik/tenants/tests/test_recovery.py @@ -2,7 +2,6 @@ from json import loads from django.urls import reverse -from django_tenants.utils import get_public_schema_name from authentik.core.models import Token, TokenIntents, User from authentik.lib.config import CONFIG @@ -19,7 +18,10 @@ class TestAPI(TenantAPITestCase): def setUp(self): super().setUp() - self.tenant = Tenant.objects.get(schema_name=get_public_schema_name()) + self.tenant = Tenant.objects.create( + name=generate_id(), + schema_name="t_" + generate_id(length=63 - 2) + ) self.user: User = User.objects.create_user(username="recovery-test-user") @CONFIG.patch("outposts.disable_embedded_outpost", True) @@ -86,3 +88,4 @@ class TestAPI(TenantAPITestCase): headers=HEADERS, ) self.assertEqual(response.status_code, 404) + self.assertEqual(len(Token.objects.all()), 0) diff --git a/scripts/create_bucket.sh b/scripts/create_bucket.sh old mode 100644 new mode 100755