mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +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:
parent
7ba6ebe914
commit
847f46e9bf
47 changed files with 184 additions and 209 deletions
|
|
@ -20,7 +20,7 @@ class ExplainTests(TestCase):
|
|||
Tag.objects.filter(name="test").annotate(Count("children")),
|
||||
Tag.objects.filter(name="test").values_list("name"),
|
||||
Tag.objects.order_by().union(Tag.objects.order_by().filter(name="test")),
|
||||
Tag.objects.all().select_for_update().filter(name="test"),
|
||||
Tag.objects.select_for_update().filter(name="test"),
|
||||
]
|
||||
supported_formats = connection.features.supported_explain_formats
|
||||
all_formats = (
|
||||
|
|
@ -60,7 +60,7 @@ class ExplainTests(TestCase):
|
|||
@skipUnlessDBFeature("validates_explain_options")
|
||||
def test_unknown_options(self):
|
||||
with self.assertRaisesMessage(ValueError, "Unknown options: test, test2"):
|
||||
Tag.objects.all().explain(test=1, test2=1)
|
||||
Tag.objects.explain(test=1, test2=1)
|
||||
|
||||
def test_unknown_format(self):
|
||||
msg = "DOES NOT EXIST is not a recognized format."
|
||||
|
|
@ -69,7 +69,7 @@ class ExplainTests(TestCase):
|
|||
sorted(connection.features.supported_explain_formats)
|
||||
)
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Tag.objects.all().explain(format="does not exist")
|
||||
Tag.objects.explain(format="does not exist")
|
||||
|
||||
@unittest.skipUnless(connection.vendor == "postgresql", "PostgreSQL specific")
|
||||
def test_postgres_options(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue