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-inheritancefix_request_path_info
parent
b718acf005
commit
318dd3d67a
|
|
@ -582,7 +582,7 @@ __test__ = {"doctest": """
|
||||||
>>> type(ModelWithMyManager.objects)
|
>>> type(ModelWithMyManager.objects)
|
||||||
<class 'polymorphic.tests.MyManager'>
|
<class 'polymorphic.tests.MyManager'>
|
||||||
>>> type(ModelWithMyManager._default_manager)
|
>>> type(ModelWithMyManager._default_manager)
|
||||||
<class 'polymorphic.tests.MyManager'>
|
<class 'polymorphic.manager.PolymorphicManager'>
|
||||||
|
|
||||||
|
|
||||||
### Manager Inheritance
|
### Manager Inheritance
|
||||||
|
|
@ -592,11 +592,11 @@ __test__ = {"doctest": """
|
||||||
|
|
||||||
# check for correct default manager
|
# check for correct default manager
|
||||||
>>> type(MROBase1._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
|
# Django vanilla inheritance does not inherit MyManager as _default_manager here
|
||||||
>>> type(MROBase2._default_manager)
|
>>> type(MROBase2._default_manager)
|
||||||
<class 'polymorphic.tests.MyManager'>
|
<class 'polymorphic.manager.PolymorphicManager'>
|
||||||
|
|
||||||
|
|
||||||
### fixed issue in PolymorphicModel.__getattribute__: field name same as model name
|
### fixed issue in PolymorphicModel.__getattribute__: field name same as model name
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue