Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed test suite on Oracle that was broken by using keyword "…

…date" as a field name. Refs #4140 and #10422.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1fe7eb603d40da5ebab3589073c287844b614853 1 parent 8397c1f
Matt Boersma authored
2  tests/regressiontests/model_forms_regress/models.py
@@ -17,7 +17,7 @@ class FilePathModel(models.Model):
17 17
 
18 18
 class Publication(models.Model):
19 19
     title = models.CharField(max_length=30)
20  
-    date = models.DateField()
  20
+    date_published = models.DateField()
21 21
 
22 22
     def __unicode__(self):
23 23
         return self.title
10  tests/regressiontests/model_forms_regress/tests.py
@@ -71,13 +71,13 @@ def test_callable(self):
71 71
         # Set up a callable initial value
72 72
         def formfield_for_dbfield(db_field, **kwargs):
73 73
             if db_field.name == 'publications':
74  
-                kwargs['initial'] = lambda: Publication.objects.all().order_by('date')[:2]
  74
+                kwargs['initial'] = lambda: Publication.objects.all().order_by('date_published')[:2]
75 75
             return db_field.formfield(**kwargs)
76 76
 
77 77
         # Set up some Publications to use as data
78  
-        Publication(title="First Book", date=date(2007,1,1)).save()
79  
-        Publication(title="Second Book", date=date(2008,1,1)).save()
80  
-        Publication(title="Third Book", date=date(2009,1,1)).save()
  78
+        Publication(title="First Book", date_published=date(2007,1,1)).save()
  79
+        Publication(title="Second Book", date_published=date(2008,1,1)).save()
  80
+        Publication(title="Third Book", date_published=date(2009,1,1)).save()
81 81
 
82 82
         # Create a ModelForm, instantiate it, and check that the output is as expected
83 83
         ModelForm = modelform_factory(Article, formfield_callback=formfield_for_dbfield)
@@ -88,5 +88,3 @@ def formfield_for_dbfield(db_field, **kwargs):
88 88
 <option value="2" selected="selected">Second Book</option>
89 89
 <option value="3">Third Book</option>
90 90
 </select>  Hold down "Control", or "Command" on a Mac, to select more than one.</li>""")
91  
-
92  
-

0 notes on commit 1fe7eb6

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