Skip to content

Commit

Permalink
Added missing method to TenantTestCase. Fixes #227.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardopires committed Jan 16, 2015
1 parent 45c9ee9 commit d98b700
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tenant_schemas/test/cases.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import django
from django.core.management import call_command
from django.db import connection
from django.test import TestCase

from tenant_schemas.utils import get_tenant_model
from tenant_schemas.utils import get_public_schema_name


class TenantTestCase(TestCase):
Expand All @@ -20,3 +24,20 @@ def tearDownClass(cls):

cursor = connection.cursor()
cursor.execute('DROP SCHEMA test CASCADE')

@classmethod
def sync_shared(cls):
if django.VERSION >= (1, 7, 0):
call_command('migrate_schemas',
schema_name=get_public_schema_name(),
interactive=False,
verbosity=0)
else:
call_command('sync_schemas',
schema_name=get_public_schema_name(),
tenant=False,
public=True,
interactive=False,
migrate_all=True,
verbosity=0,
)

0 comments on commit d98b700

Please sign in to comment.