summaryrefslogtreecommitdiff
path: root/tests/admin_checks
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2021-01-13 16:19:22 +0000
committerGitHub <noreply@github.com>2021-01-13 17:19:22 +0100
commit920448539631b52dcee53bd32a880abbc9de18bd (patch)
tree03dd52fd206088302de11e0b485b420726718a4a /tests/admin_checks
parent83fcfc9ec8610540948815e127101f1206562ead (diff)
downloaddjango-920448539631b52dcee53bd32a880abbc9de18bd.tar.gz
Fixed #16117 -- Added decorators for admin action and display functions.
Refs #25134, #32099.
Diffstat (limited to 'tests/admin_checks')
-rw-r--r--tests/admin_checks/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
index 5744dc1b39..139b6dec59 100644
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -692,6 +692,7 @@ class SystemChecksTestCase(SimpleTestCase):
self.assertEqual(errors, [])
def test_readonly_on_method(self):
+ @admin.display
def my_function(obj):
pass
@@ -705,6 +706,7 @@ class SystemChecksTestCase(SimpleTestCase):
class SongAdmin(admin.ModelAdmin):
readonly_fields = ("readonly_method_on_modeladmin",)
+ @admin.display
def readonly_method_on_modeladmin(self, obj):
pass
@@ -717,6 +719,7 @@ class SystemChecksTestCase(SimpleTestCase):
def __getattr__(self, item):
if item == "dynamic_method":
+ @admin.display
def method(obj):
pass
return method
@@ -777,6 +780,7 @@ class SystemChecksTestCase(SimpleTestCase):
def test_extra(self):
class SongAdmin(admin.ModelAdmin):
+ @admin.display
def awesome_song(self, instance):
if instance.title == "Born to Run":
return "Best Ever!"