-
Notifications
You must be signed in to change notification settings - Fork 352
Closed
Description
In our setup, we need to setup select postgres schemas for the app to work as expected. So I'd like to run a couple of commands after migrations are run.
The common recommendation everywhere is to use a session-scoped fixture with autouse=True. However, they are limited to the module. Is there a guaranteed way to run a function immediately after db migrations but before tests ?
I'd like to run the following function before tests. any pointers welcome :)
@pytest.fixture(scope="session", autouse=True)
def django_db_setup(django_db_setup, django_db_blocker):
with django_db_blocker.unblock():
tenant = Tenant(
name="Test Environment",
schema_name="testenv",
tenant_key="TESTENV",
frontend_url="http://localhost:3000",
notification_email="tech@example.com",
)
tenant.save()Metadata
Metadata
Assignees
Labels
No labels