This Django application demonstrates a bug in django-polymorphic.
The application djangoPolymorphicTestcase
has three model classes:
Base
, apolymorphic.models.PolymorphicModel
VariantA
, which inherits fromBase
VariantB
, which inherits fromBase
The test creates a VariantA
object with primary key of DUPLICATE
.
It then creates a VariantB
object with a primary key of DUPLICATE
.
As a result we do not have two objects, but a single VariantB
object.
Accessing it via VariantA.objects()
is possible, but throws TypeError
.
PYTHONPATH=/usr/lib/python3/dist-packages/ python3 ./manage.py test