summaryrefslogtreecommitdiff
path: root/tests/invalid_models_tests/test_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/invalid_models_tests/test_models.py')
-rw-r--r--tests/invalid_models_tests/test_models.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py
index ffc7579e10..9e2a37b79a 100644
--- a/tests/invalid_models_tests/test_models.py
+++ b/tests/invalid_models_tests/test_models.py
@@ -1070,6 +1070,31 @@ class ShadowingFieldsTests(SimpleTestCase):
],
)
+ def test_diamond_mti_common_parent(self):
+ class GrandParent(models.Model):
+ pass
+
+ class Parent(GrandParent):
+ pass
+
+ class Child(Parent):
+ pass
+
+ class MTICommonParentModel(Child, GrandParent):
+ pass
+
+ self.assertEqual(
+ MTICommonParentModel.check(),
+ [
+ Error(
+ "The field 'grandparent_ptr' clashes with the field "
+ "'grandparent_ptr' from model 'invalid_models_tests.parent'.",
+ obj=MTICommonParentModel,
+ id="models.E006",
+ )
+ ],
+ )
+
def test_id_clash(self):
class Target(models.Model):
pass