Skip to content

Commit

Permalink
Added explicit order_by filters to some model_forms tests that were f…
Browse files Browse the repository at this point in the history
…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
nightflyerkilo committed Sep 15, 2007
1 parent ad821b6 commit c74ebab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/modeltests/model_forms/models.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __unicode__(self):
>>> obj = f.save() >>> obj = f.save()
>>> obj >>> obj
<Category: It's a test> <Category: It's a test>
>>> Category.objects.all() >>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>] [<Category: Entertainment>, <Category: It's a test>]
If you call save() with commit=False, then it will return an object that If you call save() with commit=False, then it will return an object that
Expand All @@ -129,10 +129,10 @@ def __unicode__(self):
>>> obj = f.save(commit=False) >>> obj = f.save(commit=False)
>>> obj >>> obj
<Category: Third test> <Category: Third test>
>>> Category.objects.all() >>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>] [<Category: Entertainment>, <Category: It's a test>]
>>> obj.save() >>> obj.save()
>>> Category.objects.all() >>> Category.objects.order_by('name')
[<Category: Entertainment>, <Category: It's a test>, <Category: Third test>] [<Category: Entertainment>, <Category: It's a test>, <Category: Third test>]
If you call save() with invalid data, you'll get a ValueError. If you call save() with invalid data, you'll get a ValueError.
Expand Down Expand Up @@ -327,7 +327,7 @@ def __unicode__(self):
>>> new_art.id >>> new_art.id
2 2
>>> new_art = Article.objects.get(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>] [<Category: Entertainment>, <Category: It's a test>]
Create a new article, with no categories, via the form. Create a new article, with no categories, via the form.
Expand Down Expand Up @@ -360,7 +360,7 @@ def __unicode__(self):
# Save the m2m data on the form # Save the m2m data on the form
>>> f.save_m2m() >>> f.save_m2m()
>>> new_art.categories.all() >>> new_art.categories.order_by('name')
[<Category: Entertainment>, <Category: It's a test>] [<Category: Entertainment>, <Category: It's a test>]
Here, we define a custom Form. Because it happens to have the same fields as Here, we define a custom Form. Because it happens to have the same fields as
Expand Down

0 comments on commit c74ebab

Please sign in to comment.