summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_validation
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-26 16:52:31 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-26 16:52:31 +0000
commite0139910f19e356cc826dc6c4fc870ec18fb647d (patch)
treef285664e4d8e50356f80097eadb8caa45b159da6 /tests/regressiontests/admin_validation
parentb9eb94e789c6f31047c6fa6b89654d0657605470 (diff)
Fixed #15669 -- Included app label in admin validation messages. Thanks, lamby and Jure Cuhalev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16462 bcc190cf-cafb-0310-a4f2-bffc1f526a37
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