1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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
This commit is contained in:
Jannis Leidel
2011-06-26 16:52:31 +00:00
parent b9eb94e789
commit e0139910f1
3 changed files with 29 additions and 17 deletions

View File

@@ -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