From 6f4e933fcc78da11ec43214efd3472192030eced Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 1 Jul 2007 01:17:51 +0000 Subject: newforms-admin: Merged to [5571] git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5572 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/tests.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'tests/regressiontests/forms/tests.py') diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 4114919c2e..892498c3ae 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -1860,8 +1860,12 @@ ValidationError: [u'Enter a valid date.'] >>> f = SplitDateTimeField(required=False) >>> f.clean([datetime.date(2006, 1, 10), datetime.time(7, 30)]) datetime.datetime(2006, 1, 10, 7, 30) +>>> f.clean(['2006-01-10', '07:30']) +datetime.datetime(2006, 1, 10, 7, 30) >>> f.clean(None) >>> f.clean('') +>>> f.clean(['']) +>>> f.clean(['', '']) >>> f.clean('hello') Traceback (most recent call last): ... @@ -1878,6 +1882,18 @@ ValidationError: [u'Enter a valid time.'] Traceback (most recent call last): ... ValidationError: [u'Enter a valid date.'] +>>> f.clean(['2006-01-10', '']) +Traceback (most recent call last): +... +ValidationError: [u'Enter a valid time.'] +>>> f.clean(['2006-01-10']) +Traceback (most recent call last): +... +ValidationError: [u'Enter a valid time.'] +>>> f.clean(['', '07:30']) +Traceback (most recent call last): +... +ValidationError: [u'Enter a valid date.'] ######### # Forms # @@ -1959,11 +1975,11 @@ AttributeError: 'Person' object has no attribute 'cleaned_data'
  • >>> print p.as_p() -

    +

    -

    +

    -

    +

    If you don't pass any values to the Form's __init__(), or if you pass None, @@ -2669,7 +2685,7 @@ its field's order in the form.
  • Last name:
  • Birthday:
  • >>> print p.as_p() -

    +

    First name:

    Last name:

    Birthday:

    -- cgit v1.3