Decouple scopes from tenancy schema
This commit is contained in:
@@ -73,6 +73,7 @@ from govoplan_core.core.registry import PlatformRegistry
|
||||
from govoplan_core.db.base import Base
|
||||
from govoplan_core.server.app import create_app
|
||||
from govoplan_core.server.config import GovoplanServerConfig
|
||||
from govoplan_core.tenancy.scope import create_scope_tables
|
||||
from govoplan_access.backend.db.models import (
|
||||
Account,
|
||||
Function,
|
||||
@@ -604,6 +605,7 @@ class AccessContractTests(unittest.TestCase):
|
||||
root = Path(tempfile.mkdtemp(prefix="govoplan-access-directory-"))
|
||||
try:
|
||||
with temporary_database(f"sqlite:///{root / 'directory.db'}") as database:
|
||||
create_scope_tables(database.engine)
|
||||
Base.metadata.create_all(bind=database.engine)
|
||||
with database.session() as session:
|
||||
tenant = Tenant(id="tenant-directory", slug="directory", name="Directory Tenant", settings={})
|
||||
@@ -716,6 +718,7 @@ class AccessContractTests(unittest.TestCase):
|
||||
root = Path(tempfile.mkdtemp(prefix="govoplan-access-semantic-api-"))
|
||||
try:
|
||||
with temporary_database(f"sqlite:///{root / 'semantic.db'}") as database:
|
||||
create_scope_tables(database.engine)
|
||||
Base.metadata.create_all(bind=database.engine)
|
||||
tenant_id = "tenant-semantic"
|
||||
account_id = "account-semantic"
|
||||
@@ -906,6 +909,7 @@ class AccessContractTests(unittest.TestCase):
|
||||
with temporary_database(f"sqlite:///{root / 'test.db'}") as database:
|
||||
app = create_app(config)
|
||||
|
||||
create_scope_tables(database.engine)
|
||||
Base.metadata.create_all(bind=database.engine)
|
||||
with database.session() as session:
|
||||
tenant = Tenant(id=tenant_id, slug="capability", name="Capability Tenant", settings={})
|
||||
|
||||
Reference in New Issue
Block a user