Fixed the default manager test failures.

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
fix_request_path_info
Ben Konrath 2013-03-17 16:23:01 +01:00
parent b718acf005
commit 318dd3d67a
1 changed files with 3 additions and 3 deletions

View File

@ -582,7 +582,7 @@ __test__ = {"doctest": """
>>> type(ModelWithMyManager.objects)
<class 'polymorphic.tests.MyManager'>
>>> type(ModelWithMyManager._default_manager)
<class 'polymorphic.tests.MyManager'>
<class 'polymorphic.manager.PolymorphicManager'>
### Manager Inheritance
@ -592,11 +592,11 @@ __test__ = {"doctest": """
# check for correct default manager
>>> type(MROBase1._default_manager)
<class 'polymorphic.tests.MyManager'>
<class 'polymorphic.manager.PolymorphicManager'>
# Django vanilla inheritance does not inherit MyManager as _default_manager here
>>> type(MROBase2._default_manager)
<class 'polymorphic.tests.MyManager'>
<class 'polymorphic.manager.PolymorphicManager'>
### fixed issue in PolymorphicModel.__getattribute__: field name same as model name