summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/fields.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-11-29 19:22:03 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-11-29 19:22:03 +0000
commit7a166f1a1c126bea547ad00387ff134ee4743b1c (patch)
tree2cf70f6932c4588e0eccdb575e71edce50a19d54 /tests/regressiontests/forms/fields.py
parent4cbc8c62cf0f1e5408425c355cde7b021eb4a31e (diff)
Fixed #5959 -- Fixed handling of False values in hidden boolean fields. Thanks,
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/fields.py')
-rw-r--r--tests/regressiontests/forms/fields.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
index 3b93d70338..1c436ce680 100644
--- a/tests/regressiontests/forms/fields.py
+++ b/tests/regressiontests/forms/fields.py
@@ -914,6 +914,11 @@ False
>>> f.clean('Django rocks')
True
+>>> f.clean('True')
+True
+>>> f.clean('False')
+False
+
>>> f = BooleanField(required=False)
>>> f.clean('')
False
@@ -930,6 +935,11 @@ False
>>> f.clean('Django rocks')
True
+A form's BooleanField with a hidden widget will output the string 'False', so
+that should clean to the boolean value False:
+>>> f.clean('False')
+False
+
# ChoiceField #################################################################
>>> f = ChoiceField(choices=[('1', '1'), ('2', '2')])