summaryrefslogtreecommitdiff
path: root/tests/defer
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2022-02-22 09:29:38 +0000
committerGitHub <noreply@github.com>2022-02-22 10:29:38 +0100
commit847f46e9bf88964484c8b76a10af753ea1018311 (patch)
tree13aced534cbae373f47cce8fce1444ad0e8e01d3 /tests/defer
parent7ba6ebe9149ae38257d70100e8bfbfd0da189862 (diff)
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')
-rw-r--r--tests/defer/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/defer/tests.py b/tests/defer/tests.py
index 244564bf69..d2cff258b4 100644
--- a/tests/defer/tests.py
+++ b/tests/defer/tests.py
@@ -48,7 +48,7 @@ class DeferTests(AssertionMixin, TestCase):
# You can use 'pk' with reverse foreign key lookups.
# The related_id is always set even if it's not fetched from the DB,
# so pk and related_id are not deferred.
- self.assert_delayed(self.s1.primary_set.all().only("pk")[0], 2)
+ self.assert_delayed(self.s1.primary_set.only("pk")[0], 2)
def test_defer_only_chaining(self):
qs = Primary.objects.all()
@@ -248,7 +248,7 @@ class TestDefer2(AssertionMixin, TestCase):
"""
related = Secondary.objects.create(first="x1", second="x2")
ChildProxy.objects.create(name="p1", value="xx", related=related)
- children = ChildProxy.objects.all().select_related().only("id", "name")
+ children = ChildProxy.objects.select_related().only("id", "name")
self.assertEqual(len(children), 1)
child = children[0]
self.assert_delayed(child, 2)