Added app labels to related fields checks messages E302-E305.

This commit is contained in:
Mariusz Felisiak 2020-12-28 12:48:07 +01:00
parent 72d04e0385
commit 45519937e5
4 changed files with 222 additions and 111 deletions

View file

@ -225,19 +225,24 @@ class AbstractInheritanceTests(SimpleTestCase):
Foo._meta.get_field('foo').check(),
[
Error(
"Reverse accessor for 'Foo.foo' clashes with field name 'Descendant.foo'.",
"Reverse accessor for 'model_inheritance.Foo.foo' clashes "
"with field name 'model_inheritance.Descendant.foo'.",
hint=(
"Rename field 'Descendant.foo', or add/change a related_name "
"argument to the definition for field 'Foo.foo'."
"Rename field 'model_inheritance.Descendant.foo', or "
"add/change a related_name argument to the definition "
"for field 'model_inheritance.Foo.foo'."
),
obj=Foo._meta.get_field('foo'),
id='fields.E302',
),
Error(
"Reverse query name for 'Foo.foo' clashes with field name 'Descendant.foo'.",
"Reverse query name for 'model_inheritance.Foo.foo' "
"clashes with field name "
"'model_inheritance.Descendant.foo'.",
hint=(
"Rename field 'Descendant.foo', or add/change a related_name "
"argument to the definition for field 'Foo.foo'."
"Rename field 'model_inheritance.Descendant.foo', or "
"add/change a related_name argument to the definition "
"for field 'model_inheritance.Foo.foo'."
),
obj=Foo._meta.get_field('foo'),
id='fields.E303',