From f47857265cad7168d5ada3f307d6036d014793ef Mon Sep 17 00:00:00 2001 From: Matt Covalt Date: Wed, 20 May 2020 15:46:08 -0400 Subject: [PATCH] Test that FK lookup resolves child when using an AbstractModel --- polymorphic/tests/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/polymorphic/tests/models.py b/polymorphic/tests/models.py index 96e361fd..c1f81e15 100644 --- a/polymorphic/tests/models.py +++ b/polymorphic/tests/models.py @@ -110,7 +110,12 @@ class Enhance_Inherit(Enhance_Base, Enhance_Plain): field_i = models.CharField(max_length=10) -class RelationBase(ShowFieldTypeAndContent, PolymorphicModel): +class RelationAbstractModel(models.Model): + class Meta: + abstract = True + + +class RelationBase(RelationAbstractModel, ShowFieldTypeAndContent, PolymorphicModel): field_base = models.CharField(max_length=10) fk = models.ForeignKey( "self", on_delete=models.CASCADE, null=True, related_name="relationbase_set"