From 631bb7d0f6f4160b8d4034392f5f1e1b31490aae Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 12 Sep 2010 22:27:59 +0000 Subject: [PATCH] Added a test for hidden SplitDateTime fields. Thanks, seveas. Fixed #11213 git-svn-id: http://code.djangoproject.com/svn/django/trunk@13816 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/forms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py index 9e45a267db..91594139f2 100644 --- a/tests/regressiontests/forms/forms.py +++ b/tests/regressiontests/forms/forms.py @@ -522,6 +522,18 @@ tags. +DateTimeField rendered as_hidden() is special too + +>>> class MessageForm(Form): +... when = SplitDateTimeField() +>>> f = MessageForm({'when_0': '1992-01-01', 'when_1': '01:01'}) +>>> print f.is_valid() +True +>>> print f['when'] + +>>> print f['when'].as_hidden() + + MultipleChoiceField can also be used with the CheckboxSelectMultiple widget. >>> class SongForm(Form): ... name = CharField()