From fc779fe55aec84994e7e761c743716ba03484bcc Mon Sep 17 00:00:00 2001 From: Jeremy Dunck Date: Mon, 25 Jun 2007 19:33:37 +0000 Subject: gis: Merged revisions 5491-5539 via svnmerge from http://code.djangoproject.com/svn/django/trunk git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@5540 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 4844267b43..0808ebe97e 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -1859,8 +1859,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): ... @@ -1877,6 +1881,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 # @@ -1958,11 +1974,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, @@ -2668,7 +2684,7 @@ its field's order in the form.
  • Last name:
  • Birthday:
  • >>> print p.as_p() -

    +

    First name:

    Last name:

    Birthday:

    -- cgit v1.3