Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt 2024-01-12 03:56:55 +01:00
parent 0a15cf7452
commit 941b8a72aa
No known key found for this signature in database
GPG Key ID: 9C3FA22FABF1AA8D
2 changed files with 2 additions and 3 deletions

View File

@ -13,6 +13,7 @@ HEADERS = {"Authorization": f"Bearer {TENANTS_API_KEY}"}
class TestSettingsAPI(TenantAPITestCase): class TestSettingsAPI(TenantAPITestCase):
"""Test settings API""" """Test settings API"""
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.tenant_1 = Tenant.objects.create( self.tenant_1 = Tenant.objects.create(

View File

@ -10,9 +10,7 @@ class TenantAPITestCase(APITransactionTestCase):
for db_name in self._databases_names(include_mirrors=False): for db_name in self._databases_names(include_mirrors=False):
connections[db_name].set_schema_to_public() connections[db_name].set_schema_to_public()
with connections[db_name].cursor() as cursor: with connections[db_name].cursor() as cursor:
cursor.execute( cursor.execute("SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname ~ 't_.*'")
"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname ~ 't_.*'"
)
schemas = cursor.fetchall() schemas = cursor.fetchall()
for row in schemas: for row in schemas:
schema = row[0] schema = row[0]