Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added explicit order_by filters to some model_forms tests that were f…

…ailing in Oracle due to returning results in the wrong order.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c74ebab686021f3439634b658afb5130b71677e8 1 parent ad821b6
Ian Kelly ikelly authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/modeltests/model_forms/models.py
10 tests/modeltests/model_forms/models.py
View
@@ -115,7 +115,7 @@ def __unicode__(self):
>>> obj = f.save()
>>> obj
<Category: It's a test>
->>> Category.objects.all()
+>>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>]
If you call save() with commit=False, then it will return an object that
@@ -129,10 +129,10 @@ def __unicode__(self):
>>> obj = f.save(commit=False)
>>> obj
<Category: Third test>
->>> Category.objects.all()
+>>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>]
>>> obj.save()
->>> Category.objects.all()
+>>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>, <Category: Third test>]
If you call save() with invalid data, you'll get a ValueError.
@@ -327,7 +327,7 @@ def __unicode__(self):
>>> new_art.id
2
>>> new_art = Article.objects.get(id=2)
->>> new_art.categories.all()
+>>> new_art.categories.order_by('name')
[<Category: Entertainment>, <Category: It's a test>]
Create a new article, with no categories, via the form.
@@ -360,7 +360,7 @@ def __unicode__(self):
# Save the m2m data on the form
>>> f.save_m2m()
->>> new_art.categories.all()
+>>> new_art.categories.order_by('name')
[<Category: Entertainment>, <Category: It's a test>]
Here, we define a custom Form. Because it happens to have the same fields as
Please sign in to comment.
Something went wrong with that request. Please try again.