diff --git a/ietf/settings_sqlitetest.py b/ietf/settings_sqlitetest.py index 5a9a10e31..33f58db97 100644 --- a/ietf/settings_sqlitetest.py +++ b/ietf/settings_sqlitetest.py @@ -48,3 +48,8 @@ NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir") MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'test/media/') # pyflakes:ignore MEDIA_URL = '/test/media/' PHOTOS_DIR = MEDIA_ROOT + PHOTOS_DIRNAME # pyflakes:ignore + +# Undo any developer-dependent middleware when running the tests +MIDDLEWARE_CLASSES = [ c for c in MIDDLEWARE_CLASSES if not c in DEV_MIDDLEWARE_CLASSES ] # pyflakes:ignore + +TEMPLATES[0]['OPTIONS']['context_processors'] = [ p for p in TEMPLATES[0]['OPTIONS']['context_processors'] if not p in DEV_TEMPLATE_CONTEXT_PROCESSORS ] # pyflakes:ignore diff --git a/ietf/utils/test_runner.py b/ietf/utils/test_runner.py index 1c3420c97..4f315bf05 100644 --- a/ietf/utils/test_runner.py +++ b/ietf/utils/test_runner.py @@ -396,7 +396,7 @@ class IetfTestRunner(DiscoverRunner): settings.TEMPLATES[0]['OPTIONS']['loaders'] = ('ietf.utils.test_runner.TemplateCoverageLoader',) + settings.TEMPLATES[0]['OPTIONS']['loaders'] - settings.MIDDLEWARE_CLASSES = ('ietf.utils.test_runner.RecordUrlsMiddleware',) + settings.MIDDLEWARE_CLASSES + settings.MIDDLEWARE_CLASSES = ('ietf.utils.test_runner.RecordUrlsMiddleware',) + tuple(settings.MIDDLEWARE_CLASSES) url_coverage_collection = True self.code_coverage_checker = settings.TEST_CODE_COVERAGE_CHECKER