Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1fe7eb603d40da5ebab3589073c287844b614853 1 parent 8397c1f
@mboersma mboersma authored
2  tests/regressiontests/model_forms_regress/
@@ -17,7 +17,7 @@ class FilePathModel(models.Model):
class Publication(models.Model):
title = models.CharField(max_length=30)
- date = models.DateField()
+ date_published = models.DateField()
def __unicode__(self):
return self.title
10 tests/regressiontests/model_forms_regress/
@@ -71,13 +71,13 @@ def test_callable(self):
# Set up a callable initial value
def formfield_for_dbfield(db_field, **kwargs):
if == 'publications':
- kwargs['initial'] = lambda: Publication.objects.all().order_by('date')[:2]
+ kwargs['initial'] = lambda: Publication.objects.all().order_by('date_published')[:2]
return db_field.formfield(**kwargs)
# Set up some Publications to use as data
- Publication(title="First Book", date=date(2007,1,1)).save()
- Publication(title="Second Book", date=date(2008,1,1)).save()
- Publication(title="Third Book", date=date(2009,1,1)).save()
+ Publication(title="First Book", date_published=date(2007,1,1)).save()
+ Publication(title="Second Book", date_published=date(2008,1,1)).save()
+ Publication(title="Third Book", date_published=date(2009,1,1)).save()
# Create a ModelForm, instantiate it, and check that the output is as expected
ModelForm = modelform_factory(Article, formfield_callback=formfield_for_dbfield)
@@ -88,5 +88,3 @@ def formfield_for_dbfield(db_field, **kwargs):
<option value="2" selected="selected">Second Book</option>
<option value="3">Third Book</option>
</select> Hold down "Control", or "Command" on a Mac, to select more than one.</li>""")
Please sign in to comment.
Something went wrong with that request. Please try again.