Changed field to "def_date" from "date" in new tests from [6568] so we 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
This commit is contained in:
parent
003b3c1a17
commit
2c22f08657
|
@ -7,7 +7,7 @@ class BoundaryModel(models.Model):
|
||||||
|
|
||||||
class Defaults(models.Model):
|
class Defaults(models.Model):
|
||||||
name = models.CharField(max_length=256, default='class default value')
|
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)
|
value = models.IntegerField(default=42)
|
||||||
|
|
||||||
__test__ = {'API_TESTS': """
|
__test__ = {'API_TESTS': """
|
||||||
|
@ -31,18 +31,18 @@ initial values.
|
||||||
>>> DefaultsForm = form_for_model(Defaults)
|
>>> DefaultsForm = form_for_model(Defaults)
|
||||||
>>> DefaultsForm().fields['name'].initial
|
>>> DefaultsForm().fields['name'].initial
|
||||||
u'class default value'
|
u'class default value'
|
||||||
>>> DefaultsForm().fields['date'].initial
|
>>> DefaultsForm().fields['def_date'].initial
|
||||||
datetime.date(1980, 1, 1)
|
datetime.date(1980, 1, 1)
|
||||||
>>> DefaultsForm().fields['value'].initial
|
>>> DefaultsForm().fields['value'].initial
|
||||||
42
|
42
|
||||||
|
|
||||||
In form_for_instance(), the initial values come from the instance's values, not
|
In form_for_instance(), the initial values come from the instance's values, not
|
||||||
the model's defaults.
|
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 = form_for_instance(foo_instance)
|
||||||
>>> InstanceForm().fields['name'].initial
|
>>> InstanceForm().fields['name'].initial
|
||||||
u'instance value'
|
u'instance value'
|
||||||
>>> InstanceForm().fields['date'].initial
|
>>> InstanceForm().fields['def_date'].initial
|
||||||
datetime.date(1969, 4, 4)
|
datetime.date(1969, 4, 4)
|
||||||
>>> InstanceForm().fields['value'].initial
|
>>> InstanceForm().fields['value'].initial
|
||||||
12
|
12
|
||||||
|
|
Loading…
Reference in New Issue