summaryrefslogtreecommitdiff
path: root/tests/model_forms/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_forms/tests.py')
-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