Skip to content

django-tenants & pytest - Issues with postgres multiple schemas. #633

Closed
@geekashu

Description

@geekashu

Hi,

I am trying to use pytest with django-tenants which uses PostgreSQL schemas to isolate clients. How do I configure pytest-django so that if I am using TenantTestCase which actually creates a test schema along with public starts to use both the schema's or set the database search path to 'search_path=test, public'.

It seems pytest is only using the public schema and thus fails to find out the test schema.

The models that I want to test gets created in test schema, isolated from public.

I read in the documentation that pytest-django doesn't play well with multiple databases. Is it true with multiple schema's as well which are in a single database?

The tests are running fine with manage.py test (Django inbuilt testing) and utilizing both the schemas.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions