summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_forms_regress
diff options
context:
space:
mode:
authorMatt Boersma <matt@sprout.org>2009-05-07 14:48:04 +0000
committerMatt Boersma <matt@sprout.org>2009-05-07 14:48:04 +0000
commit523da3801d07e27556b33661bc175138a9456410 (patch)
tree51916422dbd3d41c06a001731a8244776d6f0971 /tests/regressiontests/model_forms_regress
parent9e7388f88573532e16dee9c2acaffaa4afbdbe20 (diff)
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/trunk@10689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/model_forms_regress')
-rw-r--r--tests/regressiontests/model_forms_regress/models.py2
-rw-r--r--tests/regressiontests/model_forms_regress/tests.py10
2 files changed, 5 insertions, 7 deletions
diff --git a/tests/regressiontests/model_forms_regress/models.py b/tests/regressiontests/model_forms_regress/models.py
index 8c3f97e947..488e2bca40 100644
--- a/tests/regressiontests/model_forms_regress/models.py
+++ b/tests/regressiontests/model_forms_regress/models.py
@@ -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
diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py
index 56d04af061..ccc272eae6 100644
--- a/tests/regressiontests/model_forms_regress/tests.py
+++ b/tests/regressiontests/model_forms_regress/tests.py
@@ -71,13 +71,13 @@ class ManyToManyCallableInitialTests(TestCase):
# Set up a callable initial value
def formfield_for_dbfield(db_field, **kwargs):
if db_field.name == '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 @@ class ManyToManyCallableInitialTests(TestCase):
<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>""")
-
-