Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored March 04, 2011

Showing 1 changed file with 11 additions and 8 deletions. Show diff stats Hide diff stats

  1. 19  tests/modeltests/model_forms/models.py
19  tests/modeltests/model_forms/models.py
@@ -39,6 +39,9 @@ def __unicode__(self):
39 39
 class Writer(models.Model):
40 40
     name = models.CharField(max_length=50, help_text='Use both first and last names.')
41 41
 
  42
+    class Meta:
  43
+        ordering = ('name',)
  44
+
42 45
     def __unicode__(self):
43 46
         return self.name
44 47
 
@@ -546,8 +549,8 @@ class FlexibleDatePost(models.Model):
546 549
 <tr><th>Pub date:</th><td><input type="text" name="pub_date" /></td></tr>
547 550
 <tr><th>Writer:</th><td><select name="writer">
548 551
 <option value="" selected="selected">---------</option>
549  
-<option value="...">Mike Royko</option>
550 552
 <option value="...">Bob Woodward</option>
  553
+<option value="...">Mike Royko</option>
551 554
 </select></td></tr>
552 555
 <tr><th>Article:</th><td><textarea rows="10" cols="40" name="article"></textarea></td></tr>
553 556
 <tr><th>Status:</th><td><select name="status">
@@ -601,8 +604,8 @@ class FlexibleDatePost(models.Model):
601 604
 <li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>
602 605
 <li>Writer: <select name="writer">
603 606
 <option value="">---------</option>
604  
-<option value="..." selected="selected">Mike Royko</option>
605 607
 <option value="...">Bob Woodward</option>
  608
+<option value="..." selected="selected">Mike Royko</option>
606 609
 </select></li>
607 610
 <li>Article: <textarea rows="10" cols="40" name="article">Hello.</textarea></li>
608 611
 <li>Status: <select name="status">
@@ -664,8 +667,8 @@ class FlexibleDatePost(models.Model):
664 667
 <li>Pub date: <input type="text" name="pub_date" value="1988-01-04" /></li>
665 668
 <li>Writer: <select name="writer">
666 669
 <option value="">---------</option>
667  
-<option value="..." selected="selected">Mike Royko</option>
668 670
 <option value="...">Bob Woodward</option>
  671
+<option value="..." selected="selected">Mike Royko</option>
669 672
 </select></li>
670 673
 <li>Article: <textarea rows="10" cols="40" name="article">Hello.</textarea></li>
671 674
 <li>Status: <select name="status">
@@ -688,8 +691,8 @@ class FlexibleDatePost(models.Model):
688 691
 <li>Pub date: <input type="text" name="pub_date" /></li>
689 692
 <li>Writer: <select name="writer">
690 693
 <option value="" selected="selected">---------</option>
691  
-<option value="...">Mike Royko</option>
692 694
 <option value="...">Bob Woodward</option>
  695
+<option value="...">Mike Royko</option>
693 696
 </select></li>
694 697
 <li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
695 698
 <li>Status: <select name="status">
@@ -804,8 +807,8 @@ class FlexibleDatePost(models.Model):
804 807
 <li>Pub date: <input type="text" name="pub_date" /></li>
805 808
 <li>Writer: <select name="writer">
806 809
 <option value="" selected="selected">---------</option>
807  
-<option value="...">Mike Royko</option>
808 810
 <option value="...">Bob Woodward</option>
  811
+<option value="...">Mike Royko</option>
809 812
 </select></li>
810 813
 <li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
811 814
 <li>Status: <select name="status">
@@ -829,9 +832,9 @@ class FlexibleDatePost(models.Model):
829 832
 <li>Pub date: <input type="text" name="pub_date" /></li>
830 833
 <li>Writer: <select name="writer">
831 834
 <option value="" selected="selected">---------</option>
832  
-<option value="...">Mike Royko</option>
833 835
 <option value="...">Bob Woodward</option>
834 836
 <option value="...">Carl Bernstein</option>
  837
+<option value="...">Mike Royko</option>
835 838
 </select></li>
836 839
 <li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
837 840
 <li>Status: <select name="status">
@@ -1053,10 +1056,10 @@ class FlexibleDatePost(models.Model):
1053 1056
 >>> print form.as_p()
1054 1057
 <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
1055 1058
 <option value="" selected="selected">---------</option>
1056  
-<option value="...">Mike Royko</option>
1057 1059
 <option value="...">Bob Woodward</option>
1058 1060
 <option value="...">Carl Bernstein</option>
1059 1061
 <option value="...">Joe Better</option>
  1062
+<option value="...">Mike Royko</option>
1060 1063
 </select></p>
1061 1064
 <p><label for="id_age">Age:</label> <input type="text" name="age" id="id_age" /></p>
1062 1065
 
@@ -1073,10 +1076,10 @@ class FlexibleDatePost(models.Model):
1073 1076
 >>> print form.as_p()
1074 1077
 <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
1075 1078
 <option value="">---------</option>
1076  
-<option value="...">Mike Royko</option>
1077 1079
 <option value="..." selected="selected">Bob Woodward</option>
1078 1080
 <option value="...">Carl Bernstein</option>
1079 1081
 <option value="...">Joe Better</option>
  1082
+<option value="...">Mike Royko</option>
1080 1083
 </select></p>
1081 1084
 <p><label for="id_age">Age:</label> <input type="text" name="age" value="65" id="id_age" /></p>
1082 1085
 

0 notes on commit acd296b

Please sign in to comment.
Something went wrong with that request. Please try again.