fix recovery tests
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
parent
ca956aa70b
commit
7ce8af6192
|
@ -2,6 +2,7 @@
|
|||
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
|
||||
|
@ -18,10 +19,7 @@ class TestAPI(TenantAPITestCase):
|
|||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.tenant = Tenant.objects.create(
|
||||
name=generate_id(),
|
||||
schema_name="t_" + generate_id(length=63 - 2)
|
||||
)
|
||||
self.tenant = Tenant.objects.get(schema_name=get_public_schema_name())
|
||||
self.user: User = User.objects.create_user(username="recovery-test-user")
|
||||
|
||||
@CONFIG.patch("outposts.disable_embedded_outpost", True)
|
||||
|
|
|
@ -10,7 +10,7 @@ class TenantAPITestCase(APITransactionTestCase):
|
|||
for db_name in self._databases_names(include_mirrors=False):
|
||||
with connections[db_name].cursor() as cursor:
|
||||
cursor.execute(
|
||||
"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ 'pg_*' AND nspname != 'information_schema' AND nspname != 'public' AND nspname != 'template'"
|
||||
"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname ~ 't_.*'"
|
||||
)
|
||||
schemas = cursor.fetchall()
|
||||
for row in schemas:
|
||||
|
|
Reference in New Issue