summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Chainz <adam@adamj.eu>2016-07-27 11:10:24 +0100
committerTim Graham <timograham@gmail.com>2017-01-10 07:02:13 -0500
commit9daf8c43bdfa9f6418f6f47d202055b97244debe (patch)
tree1cd636206d52ce46f0919cd0b490f99fa7ca72f5
parentd57ecf40ebad564fafa36825b17b6c15f13cfc01 (diff)
Fixed #26961 -- Made admin checks run when DEBUG=False.
-rw-r--r--django/contrib/admin/sites.py4
-rw-r--r--tests/admin_checks/tests.py3
2 files changed, 0 insertions, 7 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index d056ef337c..b3297d04f6 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -2,7 +2,6 @@ from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
-from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured
@@ -71,9 +70,6 @@ class AdminSite(object):
Run the system checks on all ModelAdmins, except if they aren't
customized at all.
"""
- if not settings.DEBUG:
- return []
-
if app_configs is None:
app_configs = apps.get_app_configs()
app_configs = set(app_configs) # Speed up lookups below
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
index d243a56640..3d629077c5 100644
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -45,7 +45,6 @@ class MyAdmin(admin.ModelAdmin):
)
class SystemChecksTestCase(SimpleTestCase):
- @override_settings(DEBUG=True)
def test_checks_are_performed(self):
admin.site.register(Song, MyAdmin)
try:
@@ -93,7 +92,6 @@ class SystemChecksTestCase(SimpleTestCase):
]
self.assertEqual(errors, expected)
- @override_settings(DEBUG=True)
def test_custom_adminsite(self):
class CustomAdminSite(admin.AdminSite):
pass
@@ -107,7 +105,6 @@ class SystemChecksTestCase(SimpleTestCase):
finally:
custom_site.unregister(Song)
- @override_settings(DEBUG=True)
def test_allows_checks_relying_on_other_modeladmins(self):
class MyBookAdmin(admin.ModelAdmin):
def check(self, **kwargs):