# Path: boardinghouse/schema.py
# def get_schema_model():
#     """
#     Return the class that is currently set as the schema model.
#     """
#     try:
#         return apps.get_model(settings.BOARDINGHOUSE_SCHEMA_MODEL)
#     except AttributeError:
#         raise ImproperlyConfigured("BOARDINGHOUSE_SCHEMA_MODEL is not set: is 'boardinghouse' in your INSTALLED_APPS?")
#     except ValueError:
#         raise ImproperlyConfigured("BOARDINGHOUSE_SCHEMA_MODEL must be of the form 'app_label.model_name'")
#     except LookupError:
#         raise ImproperlyConfigured(
#             "BOARDINGHOUSE_SCHEMA_MODEL refers to model '{0!s}' that has not been installed".format(
#                 settings.BOARDINGHOUSE_SCHEMA_MODEL))


from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, modify_settings
from django.utils import six
from boardinghouse.schema import get_schema_model
        from boardinghouse.contrib.template.models import SchemaTemplate



class TestSwappableModel(TestCase):

    @modify_settings()
    def test_schema_model_app_not_found(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'foo.bar'
        with self.assertRaises(ImproperlyConfigured):
            get_schema_model()

    @modify_settings()
    def test_schema_model_model_not_found(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'boardinghouse.NotSchemaModel'
        with self.assertRaises(ImproperlyConfigured):
            get_schema_model()

    @modify_settings()
    def test_invalid_schema_model_string(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'foo__bar'
        with self.assertRaises(ImproperlyConfigured):

# Path: boardinghouse/schema.py
# def get_schema_model():
#     """
#     Return the class that is currently set as the schema model.
#     """
#     try:
#         return apps.get_model(settings.BOARDINGHOUSE_SCHEMA_MODEL)
#     except AttributeError:
#         raise ImproperlyConfigured("BOARDINGHOUSE_SCHEMA_MODEL is not set: is 'boardinghouse' in your INSTALLED_APPS?")
#     except ValueError:
#         raise ImproperlyConfigured("BOARDINGHOUSE_SCHEMA_MODEL must be of the form 'app_label.model_name'")
#     except LookupError:
#         raise ImproperlyConfigured(
#             "BOARDINGHOUSE_SCHEMA_MODEL refers to model '{0!s}' that has not been installed".format(
#                 settings.BOARDINGHOUSE_SCHEMA_MODEL))


# Path: tests/tests/test_swappable_model.py
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, modify_settings
from django.utils import six
from boardinghouse.schema import get_schema_model
        from boardinghouse.contrib.template.models import SchemaTemplate




class TestSwappableModel(TestCase):

    @modify_settings()
    def test_schema_model_app_not_found(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'foo.bar'
        with self.assertRaises(ImproperlyConfigured):
            get_schema_model()

    @modify_settings()
    def test_schema_model_model_not_found(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'boardinghouse.NotSchemaModel'
        with self.assertRaises(ImproperlyConfigured):
            get_schema_model()

    @modify_settings()
    def test_invalid_schema_model_string(self):
        settings.BOARDINGHOUSE_SCHEMA_MODEL = 'foo__bar'
        with self.assertRaises(ImproperlyConfigured):

            get_schema_model()