1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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.
This commit is contained in:
Nick Pope
2022-02-22 09:29:38 +00:00
committed by GitHub
parent 7ba6ebe914
commit 847f46e9bf
47 changed files with 184 additions and 209 deletions

View File

@@ -260,7 +260,7 @@ class ModelInheritanceTest(TestCase):
"""
Regression test for #11764
"""
wholesalers = list(Wholesaler.objects.all().select_related())
wholesalers = list(Wholesaler.objects.select_related())
self.assertEqual(wholesalers, [])
def test_issue_7853(self):
@@ -525,7 +525,7 @@ class ModelInheritanceTest(TestCase):
serves_pizza=True,
serves_hot_dogs=True,
)
p = Place.objects.all().select_related("restaurant")[0]
p = Place.objects.select_related("restaurant")[0]
self.assertIsInstance(p.restaurant.serves_pizza, bool)
def test_inheritance_select_related(self):