Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed field to "def_date" from "date" in new tests from [6568] so w…

…e can run the test suite against Oracle again. Refs #4140.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2c22f08657a494733b487877c8a97810cff1ef16 1 parent 003b3c1
@mboersma mboersma authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 tests/regressiontests/forms/models.py
View
8 tests/regressiontests/forms/models.py
@@ -7,7 +7,7 @@ class BoundaryModel(models.Model):
class Defaults(models.Model):
name = models.CharField(max_length=256, default='class default value')
- date = models.DateField(default = datetime.date(1980, 1, 1))
+ def_date = models.DateField(default = datetime.date(1980, 1, 1))
value = models.IntegerField(default=42)
__test__ = {'API_TESTS': """
@@ -31,18 +31,18 @@ class Defaults(models.Model):
>>> DefaultsForm = form_for_model(Defaults)
>>> DefaultsForm().fields['name'].initial
u'class default value'
->>> DefaultsForm().fields['date'].initial
+>>> DefaultsForm().fields['def_date'].initial
datetime.date(1980, 1, 1)
>>> DefaultsForm().fields['value'].initial
42
In form_for_instance(), the initial values come from the instance's values, not
the model's defaults.
->>> foo_instance = Defaults(name=u'instance value', date = datetime.date(1969, 4, 4), value = 12)
+>>> foo_instance = Defaults(name=u'instance value', def_date = datetime.date(1969, 4, 4), value = 12)
>>> InstanceForm = form_for_instance(foo_instance)
>>> InstanceForm().fields['name'].initial
u'instance value'
->>> InstanceForm().fields['date'].initial
+>>> InstanceForm().fields['def_date'].initial
datetime.date(1969, 4, 4)
>>> InstanceForm().fields['value'].initial
12
Please sign in to comment.
Something went wrong with that request. Please try again.