summaryrefslogtreecommitdiff
path: root/tests/admin_filters
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/admin_filters
parent7ba6ebe9149ae38257d70100e8bfbfd0da189862 (diff)
downloaddjango-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/admin_filters')
-rw-r--r--tests/admin_filters/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/admin_filters/tests.py b/tests/admin_filters/tests.py
index ffce914d23..45801503f1 100644
--- a/tests/admin_filters/tests.py
+++ b/tests/admin_filters/tests.py
@@ -113,7 +113,7 @@ class DepartmentListFilterLookupWithNonStringValue(SimpleListFilter):
employee.department.id, # Intentionally not a string (Refs #19318)
employee.department.code,
)
- for employee in model_admin.get_queryset(request).all()
+ for employee in model_admin.get_queryset(request)
}
)
@@ -1150,7 +1150,7 @@ class ListFiltersTests(TestCase):
# Make sure the correct queryset is returned
queryset = changelist.get_queryset(request)
- self.assertEqual(list(queryset), list(Book.objects.all().order_by("-id")))
+ self.assertEqual(list(queryset), list(Book.objects.order_by("-id")))
# Make sure the correct choice is selected
filterspec = changelist.get_filters(request)[0][1]