# Path: tenant_schemas/utils.py
# def get_tenant_model():
#     return get_model(*settings.TENANT_MODEL.split("."))


from django.apps import apps
from django.core.checks import Critical, Error, Warning
from django.test import TestCase
from django.test.utils import override_settings
from tenant_schemas.apps import best_practice
from tenant_schemas.utils import get_tenant_model
        from django.conf import settings
        from django.conf import settings
        from django.conf import settings
        'django.contrib.staticfiles',
    ])
    def test_tenant_schemas_after_custom_apps_in_installed_apps(self):
        self.assertBestPractice([])

    @override_settings(TENANT_APPS=())
    def test_tenant_apps_empty(self):
        self.assertBestPractice([
            Error("TENANT_APPS is empty.",
                  hint="Maybe you don't need this app?",
                  id="tenant_schemas.E001"),
        ])

    @override_settings(PG_EXTRA_SEARCH_PATHS=['public', 'demo1', 'demo2'])
    def test_public_schema_on_extra_search_paths(self):
        TenantModel = get_tenant_model()
        TenantModel.objects.create(
            schema_name='demo1', domain_url='demo1.example.com')
        TenantModel.objects.create(
            schema_name='demo2', domain_url='demo2.example.com')
        self.assertBestPractice([
            Critical("public can not be included on PG_EXTRA_SEARCH_PATHS."),
            Critical("Do not include tenant schemas (demo1, demo2) on PG_EXTRA_SEARCH_PATHS."),
        ])

    @override_settings(SHARED_APPS=())
    def test_shared_apps_empty(self):
        self.assertBestPractice([
            Warning("SHARED_APPS is empty.",
                    id="tenant_schemas.W002"),

# Path: tenant_schemas/utils.py
# def get_tenant_model():
#     return get_model(*settings.TENANT_MODEL.split("."))


# Path: tenant_schemas/tests/test_apps.py
from django.apps import apps
from django.core.checks import Critical, Error, Warning
from django.test import TestCase
from django.test.utils import override_settings
from tenant_schemas.apps import best_practice
from tenant_schemas.utils import get_tenant_model
        from django.conf import settings
        from django.conf import settings
        from django.conf import settings

        'django.contrib.staticfiles',
    ])
    def test_tenant_schemas_after_custom_apps_in_installed_apps(self):
        self.assertBestPractice([])

    @override_settings(TENANT_APPS=())
    def test_tenant_apps_empty(self):
        self.assertBestPractice([
            Error("TENANT_APPS is empty.",
                  hint="Maybe you don't need this app?",
                  id="tenant_schemas.E001"),
        ])

    @override_settings(PG_EXTRA_SEARCH_PATHS=['public', 'demo1', 'demo2'])
    def test_public_schema_on_extra_search_paths(self):
        TenantModel = get_tenant_model()
        TenantModel.objects.create(
            schema_name='demo1', domain_url='demo1.example.com')
        TenantModel.objects.create(
            schema_name='demo2', domain_url='demo2.example.com')
        self.assertBestPractice([
            Critical("public can not be included on PG_EXTRA_SEARCH_PATHS."),
            Critical("Do not include tenant schemas (demo1, demo2) on PG_EXTRA_SEARCH_PATHS."),
        ])

    @override_settings(SHARED_APPS=())
    def test_shared_apps_empty(self):
        self.assertBestPractice([
            Warning("SHARED_APPS is empty.",
                    id="tenant_schemas.W002"),

        ])