Open Gitouis opened 3 years ago
Hi,
I'm also using pytest for my project. I'm creating some tenants in the django_db_setup
fixture which I then can use throughout the tests, like so https://gist.github.com/rj76/c1f254dfda2e0ec9bdcb069cb2f2fe67
I did it this way:
# conftest.py
from django_tenants.test.cases import TenantTestCase
from django_tenants.test.client import TenantClient
@pytest.fixture(scope="session")
def django_db_setup(django_db_setup, django_db_blocker):
with django_db_blocker.unblock():
TenantTestCase.setUpClass()
yield
with django_db_blocker.unblock():
TenantTestCase.tearDownClass()
@pytest.fixture
def client(user):
return TenantClient(TenantTestCase.tenant)
Hi,
So basically, I want to know if there is any way to use pytest with django-tenants.
By default only the Public schema is known by pytest, is there any way to extend this to other schemas used by django-tenants?
There's no documentation about this, besides the default django test runner.
I would really appreciate if I got any hint to where to start at!
Thank you so much.