Permalink
Browse files

Edited contrib.admin check messages for grammar and consistency.

  • Loading branch information...
1 parent 90577c0 commit 3c5fc708f1a8f60c05182869f6f3ec13697bbcf2 @freakboy3742 freakboy3742 committed Mar 3, 2014
Showing with 203 additions and 182 deletions.
  1. +82 −61 django/contrib/admin/checks.py
  2. +20 −20 tests/admin_checks/tests.py
  3. +1 −1 tests/admin_views/tests.py
  4. +100 −100 tests/modeladmin/tests.py
@@ -63,11 +63,11 @@ class SongAdmin(admin.ModelAdmin):
errors = SongAdmin.check(model=Song)
expected = [
checks.Error(
- ('"list_editable[0]" refers to field "original_release", '
- 'which is not editable through the admin.'),
+ ("The value of 'list_editable[0]' refers to 'original_release', "
+ "which is not editable through the admin."),
hint=None,
obj=SongAdmin,
- id='admin.E126',
+ id='admin.E125',
)
]
self.assertEqual(errors, expected)
@@ -114,7 +114,7 @@ class ExcludedFields1(admin.ModelAdmin):
errors = ExcludedFields1.check(model=Book)
expected = [
checks.Error(
- '"exclude" must be a list or tuple.',
+ "The value of 'exclude' must be a list or tuple.",
hint=None,
obj=ExcludedFields1,
id='admin.E014',
@@ -129,7 +129,7 @@ class ExcludedFields2(admin.ModelAdmin):
errors = ExcludedFields2.check(model=Book)
expected = [
checks.Error(
- '"exclude" contains duplicate field(s).',
+ "The value of 'exclude' contains duplicate field(s).",
hint=None,
obj=ExcludedFields2,
id='admin.E015',
@@ -149,7 +149,7 @@ class ExcludedFieldsAlbumAdmin(admin.ModelAdmin):
errors = ExcludedFieldsAlbumAdmin.check(model=Album)
expected = [
checks.Error(
- '"exclude" must be a list or tuple.',
+ "The value of 'exclude' must be a list or tuple.",
hint=None,
obj=ExcludedFieldsInline,
id='admin.E014',
@@ -174,8 +174,8 @@ class AlbumAdmin(admin.ModelAdmin):
errors = AlbumAdmin.check(model=Album)
expected = [
checks.Error(
- ('Cannot exclude the field "album", because it is the foreign key '
- 'to the parent model admin_checks.Album.'),
+ ("Cannot exclude the field 'album', because it is the foreign key "
+ "to the parent model 'admin_checks.Album'."),
hint=None,
obj=SongInline,
id='admin.E201',
@@ -194,8 +194,8 @@ class RawIdNonexistingAdmin(admin.ModelAdmin):
errors = RawIdNonexistingAdmin.check(model=Album)
expected = [
checks.Error(
- ('"raw_id_fields[0]" refers to field "nonexisting", which is '
- 'missing from model admin_checks.Album.'),
+ ("The value of 'raw_id_fields[0]' refers to 'nonexisting', which is "
+ "not an attribute of 'admin_checks.Album'."),
hint=None,
obj=RawIdNonexistingAdmin,
id='admin.E002',
@@ -291,8 +291,8 @@ class SongAdmin(admin.ModelAdmin):
errors = SongAdmin.check(model=Song)
expected = [
checks.Error(
- ('"readonly_fields[1]" is neither a callable nor an attribute '
- 'of "SongAdmin" nor found in the model admin_checks.Song.'),
+ ("The value of 'readonly_fields[1]' is not a callable, an attribute "
+ "of 'SongAdmin', or an attribute of 'admin_checks.Song'."),
hint=None,
obj=SongAdmin,
id='admin.E035',
@@ -308,8 +308,8 @@ class CityInline(admin.TabularInline):
errors = CityInline.check(State)
expected = [
checks.Error(
- ('"readonly_fields[0]" is neither a callable nor an attribute '
- 'of "CityInline" nor found in the model admin_checks.City.'),
+ ("The value of 'readonly_fields[0]' is not a callable, an attribute "
+ "of 'CityInline', or an attribute of 'admin_checks.City'."),
hint=None,
obj=CityInline,
id='admin.E035',
@@ -347,8 +347,8 @@ class BookAdmin(admin.ModelAdmin):
errors = BookAdmin.check(model=Book)
expected = [
checks.Error(
- ('"fields" cannot include the ManyToManyField "authors", '
- 'because "authors" manually specifies relationship model.'),
+ ("The value of 'fields' cannot include the ManyToManyField 'authors', "
+ "because that field manually specifies a relationship model."),
hint=None,
obj=BookAdmin,
id='admin.E013',
@@ -366,8 +366,8 @@ class FieldsetBookAdmin(admin.ModelAdmin):
errors = FieldsetBookAdmin.check(model=Book)
expected = [
checks.Error(
- ('"fieldsets[1][1][\'fields\']" cannot include the ManyToManyField '
- '"authors", because "authors" manually specifies relationship model.'),
+ ("The value of 'fieldsets[1][1][\"fields\"]' cannot include the ManyToManyField "
+ "'authors', because that field manually specifies a relationship model."),
hint=None,
obj=FieldsetBookAdmin,
id='admin.E013',
@@ -471,7 +471,7 @@ class MyModelAdmin(admin.ModelAdmin):
errors = MyModelAdmin.check(model=Song)
expected = [
checks.Error(
- 'There are duplicate field(s) in "fields".',
+ "The value of 'fields' contains duplicate field(s).",
hint=None,
obj=MyModelAdmin,
id='admin.E006'
@@ -490,7 +490,7 @@ class MyModelAdmin(admin.ModelAdmin):
errors = MyModelAdmin.check(model=Song)
expected = [
checks.Error(
- 'There are duplicate field(s) in "fieldsets[0][1]".',
+ "There are duplicate field(s) in 'fieldsets[0][1]'.",
hint=None,
obj=MyModelAdmin,
id='admin.E012'
@@ -4687,7 +4687,7 @@ def test_check(self):
CityAdmin.view_on_site = []
self.assertEqual(CityAdmin.check(City), [
Error(
- '"view_on_site" is not a callable or a boolean value.',
+ "The value of 'view_on_site' must be a callable or a boolean value.",
hint=None,
obj=CityAdmin,
id='admin.E025',
Oops, something went wrong. Retry.

0 comments on commit 3c5fc70

Please sign in to comment.