Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 18, 2013
@loic loic Bug with manager inherited from concrete parents that return model in…
…stances of the wrong type.
1961272
Showing with 11 additions and 1 deletion.
  1. +2 −1 tests/model_inheritance_regress/models.py
  2. +9 −0 tests/model_inheritance_regress/tests.py
View
3 tests/model_inheritance_regress/models.py
@@ -167,7 +167,8 @@ class BirthdayParty(AbstractEvent):
pass
class BachelorParty(AbstractEvent):
- pass
+ objects = models.Manager()
+ bachelors = models.Manager()
class MessyBachelorParty(BachelorParty):
pass
View
9 tests/model_inheritance_regress/tests.py
@@ -268,6 +268,15 @@ def test_inherited_fields(self):
pos = fragment.find('pub_date')
self.assertEqual(fragment.find('pub_date', pos + 1), -1)
+ def test_inherited_manager1(self):
+ self.assertFalse(hasattr(MessyBachelorParty, 'bachelors'))
+
+ def test_inherited_manager2(self):
+ MessyBachelorParty.objects.create(
+ name='Bachelor party for Dave')
+
+ self.assertTrue(isinstance(MessyBachelorParty.bachelors.first(), MessyBachelorParty))
+
def test_queryset_update_on_parent_model(self):
"""
Regression test for #10362

No commit comments for this range

Something went wrong with that request. Please try again.