Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #15550 -- Corrected an ordering dependency in the model_forms d…

…octests. Thanks to bberes for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit acd296bb9c78c410054b80bbf96e67025ed14135 1 parent 4b746a6
Russell Keith-Magee freakboy3742 authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 tests/modeltests/model_forms/models.py
19 tests/modeltests/model_forms/models.py
View
@@ -39,6 +39,9 @@ def __unicode__(self):
class Writer(models.Model):
name = models.CharField(max_length=50, help_text='Use both first and last names.')
+ class Meta:
+ ordering = ('name',)
+
def __unicode__(self):
return self.name
@@ -546,8 +549,8 @@ class FlexibleDatePost(models.Model):
<tr><th>Pub date:</th><td><input type="text" name="pub_date" /></td></tr>
<tr><th>Writer:</th><td><select name="writer">
<option value="" selected="selected">---------</option>
-<option value="...">Mike Royko</option>
<option value="...">Bob Woodward</option>
+<option value="...">Mike Royko</option>
</select></td></tr>
<tr><th>Article:</th><td><textarea rows="10" cols="40" name="article"></textarea></td></tr>
<tr><th>Status:</th><td><select name="status">
@@ -601,8 +604,8 @@ class FlexibleDatePost(models.Model):
<li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>
<li>Writer: <select name="writer">
<option value="">---------</option>
-<option value="..." selected="selected">Mike Royko</option>
<option value="...">Bob Woodward</option>
+<option value="..." selected="selected">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article">Hello.</textarea></li>
<li>Status: <select name="status">
@@ -664,8 +667,8 @@ class FlexibleDatePost(models.Model):
<li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>
<li>Writer: <select name="writer">
<option value="">---------</option>
-<option value="..." selected="selected">Mike Royko</option>
<option value="...">Bob Woodward</option>
+<option value="..." selected="selected">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article">Hello.</textarea></li>
<li>Status: <select name="status">
@@ -688,8 +691,8 @@ class FlexibleDatePost(models.Model):
<li>Pub date: <input type="text" name="pub_date" /></li>
<li>Writer: <select name="writer">
<option value="" selected="selected">---------</option>
-<option value="...">Mike Royko</option>
<option value="...">Bob Woodward</option>
+<option value="...">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
<li>Status: <select name="status">
@@ -804,8 +807,8 @@ class FlexibleDatePost(models.Model):
<li>Pub date: <input type="text" name="pub_date" /></li>
<li>Writer: <select name="writer">
<option value="" selected="selected">---------</option>
-<option value="...">Mike Royko</option>
<option value="...">Bob Woodward</option>
+<option value="...">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
<li>Status: <select name="status">
@@ -829,9 +832,9 @@ class FlexibleDatePost(models.Model):
<li>Pub date: <input type="text" name="pub_date" /></li>
<li>Writer: <select name="writer">
<option value="" selected="selected">---------</option>
-<option value="...">Mike Royko</option>
<option value="...">Bob Woodward</option>
<option value="...">Carl Bernstein</option>
+<option value="...">Mike Royko</option>
</select></li>
<li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
<li>Status: <select name="status">
@@ -1053,10 +1056,10 @@ class FlexibleDatePost(models.Model):
>>> print form.as_p()
<p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
<option value="" selected="selected">---------</option>
-<option value="...">Mike Royko</option>
<option value="...">Bob Woodward</option>
<option value="...">Carl Bernstein</option>
<option value="...">Joe Better</option>
+<option value="...">Mike Royko</option>
</select></p>
<p><label for="id_age">Age:</label> <input type="text" name="age" id="id_age" /></p>
@@ -1073,10 +1076,10 @@ class FlexibleDatePost(models.Model):
>>> print form.as_p()
<p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
<option value="">---------</option>
-<option value="...">Mike Royko</option>
<option value="..." selected="selected">Bob Woodward</option>
<option value="...">Carl Bernstein</option>
<option value="...">Joe Better</option>
+<option value="...">Mike Royko</option>
</select></p>
<p><label for="id_age">Age:</label> <input type="text" name="age" value="65" id="id_age" /></p>
Please sign in to comment.
Something went wrong with that request. Please try again.