summaryrefslogtreecommitdiff
path: root/tests/model_forms
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/model_forms
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/model_forms')
-rw-r--r--tests/model_forms/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 592bc693af..13b871372e 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -1617,7 +1617,7 @@ class ModelFormBasicTests(TestCase):
# Set up a callable initial value
def formfield_for_dbfield(db_field, **kwargs):
if db_field.name == "categories":
- kwargs["initial"] = lambda: Category.objects.all().order_by("name")[:2]
+ kwargs["initial"] = lambda: Category.objects.order_by("name")[:2]
return db_field.formfield(**kwargs)
# Create a ModelForm, instantiate it, and check that the output is as expected