diff options
author | Fabrizio Ettore Messina <zauddelig@gmail.com> | 2015-08-13 10:03:20 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-08-13 12:34:48 -0400 |
commit | ece78684d9e09c477c4a0f10236c0aec45bac726 (patch) | |
tree | 2ae7d78c9fa4cf640db233fb0e2fc42c4460f20f /tests/admin_checks | |
parent | 0cc059cd104cdb70340bd08e597d403d80dc42a6 (diff) | |
download | django-ece78684d9e09c477c4a0f10236c0aec45bac726.tar.gz |
Fixed #25267 -- Corrected message for admin.E122 system check.
Diffstat (limited to 'tests/admin_checks')
-rw-r--r-- | tests/admin_checks/tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py index 0b4d905c1b..84f4439fe2 100644 --- a/tests/admin_checks/tests.py +++ b/tests/admin_checks/tests.py @@ -69,6 +69,22 @@ class SystemChecksTestCase(SimpleTestCase): custom_site.unregister(Song) admin.sites.system_check_errors = [] + def test_field_name_not_in_list_display(self): + class SongAdmin(admin.ModelAdmin): + list_editable = ["original_release"] + + errors = SongAdmin.check(model=Song) + expected = [ + checks.Error( + "The value of 'list_editable[0]' refers to 'original_release', " + "which is not contained in 'list_display'.", + hint=None, + obj=SongAdmin, + id='admin.E122', + ) + ] + self.assertEqual(errors, expected) + def test_readonly_and_editable(self): class SongAdmin(admin.ModelAdmin): readonly_fields = ["original_release"] |