From 318dd3d67a4a50b53861b2e15e619935445d0d73 Mon Sep 17 00:00:00 2001 From: Ben Konrath Date: Sun, 17 Mar 2013 16:23:01 +0100 Subject: [PATCH] Fixed the default manager test failures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the django docs (1.4 / 1.5), the default manager for subclasses of PolymorphicModel should be PolymorphicManager: 3. The default manager on a class is either the first manager declared on the class, if that exists, or the default manager of the first abstract base class in the parent hierarchy, if that exists. If no default manager is explicitly declared, Django’s normal default manager is used. https://docs.djangoproject.com/en/1.4/topics/db/managers/#custom-managers-and-model-inheritance https://docs.djangoproject.com/en/1.5/topics/db/managers/#custom-managers-and-model-inheritance --- polymorphic/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polymorphic/tests.py b/polymorphic/tests.py index 5ecef1b..b485722 100644 --- a/polymorphic/tests.py +++ b/polymorphic/tests.py @@ -582,7 +582,7 @@ __test__ = {"doctest": """ >>> type(ModelWithMyManager.objects) >>> type(ModelWithMyManager._default_manager) - + ### Manager Inheritance @@ -592,11 +592,11 @@ __test__ = {"doctest": """ # check for correct default manager >>> type(MROBase1._default_manager) - + # Django vanilla inheritance does not inherit MyManager as _default_manager here >>> type(MROBase2._default_manager) - + ### fixed issue in PolymorphicModel.__getattribute__: field name same as model name