diff options
author | Nick Pope <nick.pope@flightdataservices.com> | 2021-01-13 16:19:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 17:19:22 +0100 |
commit | 920448539631b52dcee53bd32a880abbc9de18bd (patch) | |
tree | 03dd52fd206088302de11e0b485b420726718a4a /tests/admin_checks | |
parent | 83fcfc9ec8610540948815e127101f1206562ead (diff) | |
download | django-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.py | 4 |
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!" |