diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/defer/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/defer/tests.py b/tests/defer/tests.py index 6badd7056e..a3ef1c58b1 100644 --- a/tests/defer/tests.py +++ b/tests/defer/tests.py @@ -188,6 +188,11 @@ class BigChildDeferTests(AssertionMixin, TestCase): self.assertEqual(obj.value, "foo") self.assertEqual(obj.other, "bar") + def test_defer_subclass_both(self): + # Deferring fields from both superclass and subclass works. + obj = BigChild.objects.defer("other", "value").get(name="b1") + self.assert_delayed(obj, 2) + def test_only_baseclass_when_subclass_has_added_field(self): # You can retrieve a single field on a baseclass obj = BigChild.objects.only("name").get(name="b1") |
