summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_validation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/admin_validation')
-rw-r--r--tests/regressiontests/admin_validation/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_validation/tests.py b/tests/regressiontests/admin_validation/tests.py
index 2cf3c60062..9e50a8b112 100644
--- a/tests/regressiontests/admin_validation/tests.py
+++ b/tests/regressiontests/admin_validation/tests.py
@@ -92,10 +92,22 @@ class ValidationTestCase(TestCase):
inlines = [SongInline]
self.assertRaisesMessage(ImproperlyConfigured,
- "SongInline cannot exclude the field 'album' - this is the foreign key to the parent model Album.",
+ "SongInline cannot exclude the field 'album' - this is the foreign key to the parent model admin_validation.Album.",
validate,
AlbumAdmin, Album)
+ def test_app_label_in_admin_validation(self):
+ """
+ Regression test for #15669 - Include app label in admin validation messages
+ """
+ class RawIdNonexistingAdmin(admin.ModelAdmin):
+ raw_id_fields = ('nonexisting',)
+
+ self.assertRaisesMessage(ImproperlyConfigured,
+ "'RawIdNonexistingAdmin.raw_id_fields' refers to field 'nonexisting' that is missing from model 'admin_validation.Album'.",
+ validate,
+ RawIdNonexistingAdmin, Album)
+
def test_fk_exclusion(self):
"""
Regression test for #11709 - when testing for fk excluding (when exclude is