summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/fields.py
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2007-11-30 06:23:24 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2007-11-30 06:23:24 +0000
commitc81b01e060ad80a5c4df579a96ff737df2d336b3 (patch)
treed34a873e7b5e19f0e91424d4ab28e2f968233d63 /tests/regressiontests/forms/fields.py
parentf88babafc58eafece72d3f2f7444336c69196808 (diff)
newforms-admin: Merged from trunk up to [6775].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/fields.py')
-rw-r--r--tests/regressiontests/forms/fields.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
index 3b93d70338..cff5db6fca 100644
--- a/tests/regressiontests/forms/fields.py
+++ b/tests/regressiontests/forms/fields.py
@@ -323,6 +323,10 @@ Decimal("3.14")
Traceback (most recent call last):
...
ValidationError: [u'Enter a number.']
+>>> f.clean(u'łąść')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a number.']
>>> f.clean('1.0 ')
Decimal("1.0")
>>> f.clean(' 1.0')
@@ -914,6 +918,11 @@ False
>>> f.clean('Django rocks')
True
+>>> f.clean('True')
+True
+>>> f.clean('False')
+False
+
>>> f = BooleanField(required=False)
>>> f.clean('')
False
@@ -930,6 +939,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')])