<s> from django . db import connection <EOL> from django . conf import settings <EOL> from django . core . management import call_command <EOL> from django . test import TransactionTestCase <EOL> from django_tenants . utils import get_public_schema_name <EOL> class BaseTestCase ( TransactionTestCase ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> settings . TENANT_MODEL = '<STR_LIT>' <EOL> settings . TENANT_DOMAIN_MODEL = '<STR_LIT>' <EOL> settings . SHARED_APPS = ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> settings . TENANT_APPS = ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , ) <EOL> settings . INSTALLED_APPS = settings . SHARED_APPS + settings . TENANT_APPS <EOL> cls . available_apps = settings . INSTALLED_APPS <EOL> super ( BaseTestCase , cls ) . setUpClass ( ) <EOL> def setUp ( self ) : <EOL> connection . set_schema_to_public ( ) <EOL> super ( BaseTestCase , self ) . setUp ( ) <EOL> @ classmethod <EOL> def get_tables_list_in_schema ( cls , schema_name ) : <EOL> cursor = connection . cursor ( ) <EOL> sql = """<STR_LIT>""" <EOL> cursor . execute ( sql , ( schema_name , ) ) <EOL> return [ row [ <NUM_LIT:0> ] for row in cursor . fetchall ( ) ] <EOL> @ classmethod <EOL> def sync_shared ( cls ) : <EOL> call_command ( '<STR_LIT>' , <EOL> schema_name = get_public_schema_name ( ) , <EOL> interactive = False , <EOL> verbosity = <NUM_LIT:0> ) </s>
