Let tests pass on Django 1.10.1

The change for https://code.djangoproject.com/ticket/27073
in d4eefc7e2a
removed the _default_manager assignment
fix_request_path_info
Diederik van der Boor 2016-09-11 21:32:10 +02:00
parent 2d6832f844
commit c97d1ef088
2 changed files with 13 additions and 5 deletions

View File

@ -92,6 +92,9 @@ class PolymorphicModelBase(ModelBase):
new_class._default_manager._inherited = False # the default mgr was defined by the user, not inherited
# validate resulting default manager
if django.VERSION >= (1, 10) and not new_class._meta.abstract:
self.validate_model_manager(new_class.objects, model_name, 'objects')
else:
self.validate_model_manager(new_class._default_manager, model_name, '_default_manager')
# for __init__ function of this class (monkeypatching inheritance accessors)

View File

@ -990,6 +990,11 @@ class PolymorphicTests(TestCase):
# by choice of MRO, should be MyManager from MROBase1.
self.assertIs(type(MRODerived.objects), MyManager)
if django.VERSION < (1, 10, 1):
# The change for https://code.djangoproject.com/ticket/27073
# in https://github.com/django/django/commit/d4eefc7e2af0d93283ed1c03e0af0a482982b6f0
# removes the assignment to _default_manager
# check for correct default manager
self.assertIs(type(MROBase1._default_manager), MyManager)