diff --git a/django/core/checks/__init__.py b/django/core/checks/__init__.py index 4a7479ab2b..0aa23dbaf4 100644 --- a/django/core/checks/__init__.py +++ b/django/core/checks/__init__.py @@ -9,7 +9,6 @@ from .registry import Tags, register, run_checks, tag_exists # Import these to force registration of checks import django.core.checks.caches # NOQA isort:skip -import django.core.checks.compatibility.django_1_8_0 # NOQA isort:skip import django.core.checks.compatibility.django_1_10 # NOQA isort:skip import django.core.checks.database # NOQA isort:skip import django.core.checks.model_checks # NOQA isort:skip diff --git a/django/core/checks/compatibility/django_1_8_0.py b/django/core/checks/compatibility/django_1_8_0.py deleted file mode 100644 index e5bbc6cfc5..0000000000 --- a/django/core/checks/compatibility/django_1_8_0.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import unicode_literals - -from django.conf import settings - -from .. import Tags, Warning, register - - -@register(Tags.compatibility) -def check_duplicate_template_settings(app_configs, **kwargs): - if settings.TEMPLATES: - values = [ - 'TEMPLATE_DIRS', - 'TEMPLATE_CONTEXT_PROCESSORS', - 'TEMPLATE_DEBUG', - 'TEMPLATE_LOADERS', - 'TEMPLATE_STRING_IF_INVALID', - ] - defined = [value for value in values if getattr(settings, value, None)] - if defined: - return [Warning( - "The standalone TEMPLATE_* settings were deprecated in Django " - "1.8 and the TEMPLATES dictionary takes precedence. You must " - "put the values of the following settings into your default " - "TEMPLATES dict: %s." % ", ".join(defined), - id='1_8.W001', - )] - return [] diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index f30d07d921..51083c5b2b 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -112,7 +112,8 @@ that might occur as a result of a version upgrade. Django 1.8 and the :setting:`TEMPLATES` dictionary takes precedence. You must put the values of the following settings into your defaults ``TEMPLATES`` dict: ``TEMPLATE_DIRS``, ``TEMPLATE_CONTEXT_PROCESSORS``, ``TEMPLATE_DEBUG``, - ``TEMPLATE_LOADERS``, ``TEMPLATE_STRING_IF_INVALID``. + ``TEMPLATE_LOADERS``, ``TEMPLATE_STRING_IF_INVALID``. *This check was removed + in Django 2.0*. * **1_10.W001**: The ``MIDDLEWARE_CLASSES`` setting is deprecated in Django 1.10 and the :setting:`MIDDLEWARE` setting takes precedence. Since you've set ``MIDDLEWARE``, the value of ``MIDDLEWARE_CLASSES`` is ignored. diff --git a/tests/check_framework/tests_1_8_compatibility.py b/tests/check_framework/tests_1_8_compatibility.py deleted file mode 100644 index d8601b1064..0000000000 --- a/tests/check_framework/tests_1_8_compatibility.py +++ /dev/null @@ -1,29 +0,0 @@ -from django.core.checks.compatibility.django_1_8_0 import \ - check_duplicate_template_settings -from django.test import SimpleTestCase -from django.test.utils import override_settings - - -class CheckDuplicateTemplateSettingsTest(SimpleTestCase): - - def test_not_raised_if_no_templates_setting(self): - self.assertEqual(check_duplicate_template_settings(None), []) - - @override_settings( - TEMPLATES=[{'BACKEND': 'django.template.backends.django.DjangoTemplates'}], - TEMPLATE_DIRS=['/path/to/dirs'], - ) - def test_duplicate_setting(self): - result = check_duplicate_template_settings(None) - self.assertEqual(result[0].id, '1_8.W001') - - @override_settings( - TEMPLATES=[{'BACKEND': 'django.template.backends.django.DjangoTemplates'}], - TEMPLATE_DIRS=['/path/to/dirs'], - TEMPLATE_DEBUG=True, - ) - def test_multiple_duplicate_settings(self): - result = check_duplicate_template_settings(None) - self.assertEqual(len(result), 1) - self.assertIn('TEMPLATE_DIRS', result[0].msg) - self.assertIn('TEMPLATE_DEBUG', result[0].msg)