diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py index 00685534ab..bc14c117d5 100644 --- a/tests/modeltests/model_forms/models.py +++ b/tests/modeltests/model_forms/models.py @@ -115,7 +115,7 @@ True >>> obj = f.save() >>> obj ->>> Category.objects.all() +>>> Category.objects.order_by('name') [, ] If you call save() with commit=False, then it will return an object that @@ -129,10 +129,10 @@ True >>> obj = f.save(commit=False) >>> obj ->>> Category.objects.all() +>>> Category.objects.order_by('name') [, ] >>> obj.save() ->>> Category.objects.all() +>>> Category.objects.order_by('name') [, , ] If you call save() with invalid data, you'll get a ValueError. @@ -327,7 +327,7 @@ Create a new article, with categories, via the form. >>> new_art.id 2 >>> new_art = Article.objects.get(id=2) ->>> new_art.categories.all() +>>> new_art.categories.order_by('name') [, ] Create a new article, with no categories, via the form. @@ -360,7 +360,7 @@ The m2m data won't be saved until save_m2m() is invoked on the form. # Save the m2m data on the form >>> f.save_m2m() ->>> new_art.categories.all() +>>> new_art.categories.order_by('name') [, ] Here, we define a custom Form. Because it happens to have the same fields as