Skip to content

Commit

Permalink
Modify existing test_switching_search_path() for django-tenants#829
Browse files Browse the repository at this point in the history
now the test uses schema names with underscores which should trigger the
failure
  • Loading branch information
atodorov committed Apr 19, 2023
1 parent d303fc1 commit 339ac3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions django_tenants/tests/test_tenants.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,19 @@ def test_sync_tenant(self):
self.created = [domain, tenant]

def test_switching_search_path(self):
tenant1 = get_tenant_model()(schema_name='tenant1')
"""
IMPORTANT: using schema_name with underscore here. See
https://github.com/django-tenants/django-tenants/pull/829
"""
tenant1 = get_tenant_model()(schema_name='tenant_1')
tenant1.save()

domain1 = get_tenant_domain_model()(tenant=tenant1, domain='something.test.com')
domain1.save()

connection.set_schema_to_public()

tenant2 = get_tenant_model()(schema_name='tenant2')
tenant2 = get_tenant_model()(schema_name='tenant_2')
tenant2.save()

domain2 = get_tenant_domain_model()(tenant=tenant2, domain='example.com')
Expand Down

0 comments on commit 339ac3a

Please sign in to comment.