diff --git a/tests/models.py b/tests/models.py index c5b9c352..886e566f 100644 --- a/tests/models.py +++ b/tests/models.py @@ -339,7 +339,13 @@ class NoProfileChild(AbsNoProfile): pass -class Mess(Post, Category): +class ParentId(models.Model): + pass + +class ParentStr(models.Model): + name = models.CharField(max_length=128, primary_key=True) + +class Mess(ParentId, ParentStr): pass class MessChild(Mess): diff --git a/tests/test_extras.py b/tests/test_extras.py index 04afb9fa..7efde394 100644 --- a/tests/test_extras.py +++ b/tests/test_extras.py @@ -188,7 +188,8 @@ def test_db_agnostic_disabled(self): def test_model_family(): from cacheops.utils import model_family from .models import Abs, Concrete1, AbsChild, Concrete2 - from .models import NoProfile, NoProfileProxy, AbsNoProfile, NoProfileChild, Mess, MessChild + from .models import NoProfile, NoProfileProxy, AbsNoProfile, NoProfileChild + from .models import ParentId, ParentStr, Mess, MessChild # Abstract models do not have family, children of an abstract model are not a family assert model_family(Abs) == set() @@ -203,4 +204,4 @@ def test_model_family(): assert model_family(NoProfileChild) == {NoProfile, NoProfileProxy, NoProfileChild} # The worst of multiple inheritance - assert model_family(Mess) == {Mess, MessChild, Post, Category} + assert model_family(Mess) == {Mess, MessChild, ParentId, ParentStr}