diff options
Diffstat (limited to 'tests/defer_regress/tests.py')
| -rw-r--r-- | tests/defer_regress/tests.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py index 2594ffcdb8..eb2fb8ecfc 100644 --- a/tests/defer_regress/tests.py +++ b/tests/defer_regress/tests.py @@ -286,12 +286,18 @@ class DeferAnnotateSelectRelatedTest(TestCase): def test_defer_annotate_select_related(self): location = Location.objects.create() Request.objects.create(location=location) - self.assertIsInstance(list(Request.objects - .annotate(Count('items')).select_related('profile', 'location') - .only('profile', 'location')), list) - self.assertIsInstance(list(Request.objects - .annotate(Count('items')).select_related('profile', 'location') - .only('profile__profile1', 'location__location1')), list) - self.assertIsInstance(list(Request.objects - .annotate(Count('items')).select_related('profile', 'location') - .defer('request1', 'request2', 'request3', 'request4')), list) + self.assertIsInstance( + list(Request.objects.annotate(Count('items')).select_related('profile', 'location') + .only('profile', 'location')), + list + ) + self.assertIsInstance( + list(Request.objects.annotate(Count('items')).select_related('profile', 'location') + .only('profile__profile1', 'location__location1')), + list + ) + self.assertIsInstance( + list(Request.objects.annotate(Count('items')).select_related('profile', 'location') + .defer('request1', 'request2', 'request3', 'request4')), + list + ) |
