diff options
author | Nick Pope <nick@nickpope.me.uk> | 2022-02-22 09:29:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 10:29:38 +0100 |
commit | 847f46e9bf88964484c8b76a10af753ea1018311 (patch) | |
tree | 13aced534cbae373f47cce8fce1444ad0e8e01d3 /tests/defer_regress | |
parent | 7ba6ebe9149ae38257d70100e8bfbfd0da189862 (diff) | |
download | django-847f46e9bf88964484c8b76a10af753ea1018311.tar.gz |
Removed redundant QuerySet.all() calls in docs and tests.
Most QuerySet methods are mapped onto the Manager and, in general,
it isn't necessary to call .all() on the manager.
Diffstat (limited to 'tests/defer_regress')
-rw-r--r-- | tests/defer_regress/tests.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/defer_regress/tests.py b/tests/defer_regress/tests.py index db2c360c6e..c7a61f53a3 100644 --- a/tests/defer_regress/tests.py +++ b/tests/defer_regress/tests.py @@ -226,7 +226,7 @@ class DeferRegressionTest(TestCase): item = Item.objects.create(name="first", value=47) RelatedItem.objects.create(item=item) # Defer fields with only() - obj = ProxyRelated.objects.all().select_related().only("item__name")[0] + obj = ProxyRelated.objects.select_related().only("item__name")[0] with self.assertNumQueries(0): self.assertEqual(obj.item.name, "first") with self.assertNumQueries(1): |