When auto_create_schema = False is on the TenantMixin model the TenantTestCase will not create the schema in the database, the next line connection.set_tenant(cls.tenant) then silently fails to set the tenant and the following tests will be run on the public schema.
In the docs it says It will automatically create a tenant for you, set the connection's schema to tenant's schema and make it available at `self.tenant`. This is not reflected in the implementation if auto_create_schema = False.
We should probably introduce a force_create argument as we have force_drop in the delete() method. So we can create the schema regardless of auto_create_schema.
When
auto_create_schema = False
is on the TenantMixin model the TenantTestCase will not create the schema in the database, the next lineconnection.set_tenant(cls.tenant)
then silently fails to set the tenant and the following tests will be run on the public schema.In the docs it says
It will automatically create a tenant for you, set the connection's schema to tenant's schema and make it available at `self.tenant`.
This is not reflected in the implementation ifauto_create_schema = False
.We should probably introduce a
force_create
argument as we haveforce_drop
in the delete() method. So we can create the schema regardless ofauto_create_schema
.Any thoughts?