# Path: boardinghouse/apps.py
# CONTEXT = 'boardinghouse.context_processors.schemata'
# MIDDLEWARE = 'boardinghouse.middleware.SchemaMiddleware'
# DB_ENGINES = ['boardinghouse.backends.postgres']
#         MIDDLEWARE_CLASSES = settings.MIDDLEWARE
#         MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES
# class BoardingHouseConfig(AppConfig):
#     def ready(self):
# def check_db_backend(app_configs=None, **kwargs):
# def check_session_middleware_installed(app_configs=None, **kwargs):
# def check_middleware_installed(app_configs=None, **kwargs):
# def check_context_processor_installed(app_configs=None, **kwargs):
# def check_installed_before_admin(app_configs=None, **kwargs):
# 
# 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 copy import deepcopy
from django.conf import settings
from django.test import TestCase, modify_settings, override_settings
from django.core import checks, exceptions
from boardinghouse import apps
from boardinghouse.schema import get_schema_model
        from django.apps import apps
import unittest
import django
        errors = apps.check_installed_before_admin()
        self.assertEqual(0, len(errors))

    @modify_settings()
    def test_context_processor_not_installed_in_TEMPLATES(self):
        templates = deepcopy(settings.TEMPLATES)
        templates[0]['OPTIONS']['context_processors'].remove(apps.CONTEXT)
        with self.settings(TEMPLATES=templates):
            errors = apps.check_context_processor_installed()
            self.assertEqual(1, len(errors))
            self.assertTrue(isinstance(errors[0], checks.Warning))
            self.assertEqual('boardinghouse.W001', errors[0].id)

    @override_settings(TEMPLATES=[{
        'BACKEND': 'django.template.backends.jinja2.Jinja2',
    }])
    def test_context_processor_not_installed_but_using_jinja(self):
        errors = apps.check_context_processor_installed()
        self.assertEqual(0, len(errors))

    @modify_settings()
    def test_no_context_processors_found(self):
        del settings.TEMPLATES
        errors = apps.check_context_processor_installed()
        self.assertEqual(1, len(errors))
        self.assertTrue(isinstance(errors[0], checks.Warning))
        self.assertEqual('boardinghouse.W001', errors[0].id)

    @modify_settings()
    def test_no_BOARDINGHOUSE_SCHEMA_MODEL(self):

# Path: boardinghouse/apps.py
# CONTEXT = 'boardinghouse.context_processors.schemata'
# MIDDLEWARE = 'boardinghouse.middleware.SchemaMiddleware'
# DB_ENGINES = ['boardinghouse.backends.postgres']
#         MIDDLEWARE_CLASSES = settings.MIDDLEWARE
#         MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES
# class BoardingHouseConfig(AppConfig):
#     def ready(self):
# def check_db_backend(app_configs=None, **kwargs):
# def check_session_middleware_installed(app_configs=None, **kwargs):
# def check_middleware_installed(app_configs=None, **kwargs):
# def check_context_processor_installed(app_configs=None, **kwargs):
# def check_installed_before_admin(app_configs=None, **kwargs):
# 
# 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_settings.py
from copy import deepcopy
from django.conf import settings
from django.test import TestCase, modify_settings, override_settings
from django.core import checks, exceptions
from boardinghouse import apps
from boardinghouse.schema import get_schema_model
        from django.apps import apps
import unittest
import django

        errors = apps.check_installed_before_admin()
        self.assertEqual(0, len(errors))

    @modify_settings()
    def test_context_processor_not_installed_in_TEMPLATES(self):
        templates = deepcopy(settings.TEMPLATES)
        templates[0]['OPTIONS']['context_processors'].remove(apps.CONTEXT)
        with self.settings(TEMPLATES=templates):
            errors = apps.check_context_processor_installed()
            self.assertEqual(1, len(errors))
            self.assertTrue(isinstance(errors[0], checks.Warning))
            self.assertEqual('boardinghouse.W001', errors[0].id)

    @override_settings(TEMPLATES=[{
        'BACKEND': 'django.template.backends.jinja2.Jinja2',
    }])
    def test_context_processor_not_installed_but_using_jinja(self):
        errors = apps.check_context_processor_installed()
        self.assertEqual(0, len(errors))

    @modify_settings()
    def test_no_context_processors_found(self):
        del settings.TEMPLATES
        errors = apps.check_context_processor_installed()
        self.assertEqual(1, len(errors))
        self.assertTrue(isinstance(errors[0], checks.Warning))
        self.assertEqual('boardinghouse.W001', errors[0].id)

    @modify_settings()
    def test_no_BOARDINGHOUSE_SCHEMA_MODEL(self):

        del settings.BOARDINGHOUSE_SCHEMA_MODEL