Kaydet (Commit) bc4dc6e9 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Edited model check messages for grammar and consistency.

üst f7587b20
......@@ -67,7 +67,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
'Field names must not end with an underscore.',
hint=None,
obj=self,
id='contenttypes.E001',
id='fields.E001',
)
]
else:
......@@ -82,7 +82,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
"The GenericForeignKey object ID references the non-existent field '%s'." % self.fk_field,
hint=None,
obj=self,
id='contenttypes.E002',
id='contenttypes.E001',
)
]
else:
......@@ -102,7 +102,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint=None,
obj=self,
id='contenttypes.E003',
id='contenttypes.E002',
)
]
else:
......@@ -114,7 +114,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint="GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field.",
obj=self,
id='contenttypes.E004',
id='contenttypes.E003',
)
]
elif field.rel.to != ContentType:
......@@ -125,7 +125,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint="GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field.",
obj=self,
id='contenttypes.E005',
id='contenttypes.E004',
)
]
else:
......@@ -282,7 +282,7 @@ class GenericRelation(ForeignObject):
return []
else:
return [
checks.Warning(
checks.Error(
("The GenericRelation defines a relation with the model "
"'%s.%s', but that model does not have a GenericForeignKey.") % (
target._meta.app_label, target._meta.object_name
......
This diff is collapsed.
......@@ -109,7 +109,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"The GenericForeignKey content type references the non-existent field 'TaggedItem.content_type'.",
hint=None,
obj=TaggedItem.content_object,
id='contenttypes.E003',
id='contenttypes.E002',
)
]
self.assertEqual(errors, expected)
......@@ -127,7 +127,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"'Model.content_type' is not a ForeignKey.",
hint="GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field.",
obj=Model.content_object,
id='contenttypes.E004',
id='contenttypes.E003',
)
]
self.assertEqual(errors, expected)
......@@ -145,7 +145,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"'Model.content_type' is not a ForeignKey to 'contenttypes.ContentType'.",
hint="GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field.",
obj=Model.content_object,
id='contenttypes.E005',
id='contenttypes.E004',
)
]
self.assertEqual(errors, expected)
......@@ -162,7 +162,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"The GenericForeignKey object ID references the non-existent field 'object_id'.",
hint=None,
obj=TaggedItem.content_object,
id='contenttypes.E002',
id='contenttypes.E001',
)
]
self.assertEqual(errors, expected)
......@@ -180,7 +180,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
'Field names must not end with an underscore.',
hint=None,
obj=Model.content_object_,
id='contenttypes.E001',
id='fields.E001',
)
]
self.assertEqual(errors, expected)
......@@ -265,7 +265,7 @@ class GenericRelationshipTests(IsolatedModelsTestCase):
errors = Bookmark.tags.field.check()
expected = [
checks.Warning(
checks.Error(
("The GenericRelation defines a relation with the model "
"'contenttypes_tests.TaggedItem', but that model does not have a "
"GenericForeignKey."),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment