summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-01-28 14:24:48 +0100
committerClaude Paroz <claude@2xlibre.net>2013-01-28 22:11:00 +0100
commitf7394d2c32b4b4717066f254adaa513d08ab32a4 (patch)
treeae048929e19a7597dae3013abcfe8b371382baa9 /tests/regressiontests/forms
parent4f16376274a4e52074722c615fccef5fac5f009a (diff)
Added HTML5 url input type
Refs #16630.
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/tests/fields.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/tests/fields.py b/tests/regressiontests/forms/tests/fields.py
index aa03377d44..fc7fc70da4 100644
--- a/tests/regressiontests/forms/tests/fields.py
+++ b/tests/regressiontests/forms/tests/fields.py
@@ -639,6 +639,7 @@ class FieldsTests(SimpleTestCase):
def test_urlfield_1(self):
f = URLField()
+ self.assertWidgetRendersTo(f, '<input type="url" name="f" id="id_f" />')
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, '')
self.assertRaisesMessage(ValidationError, "'This field is required.'", f.clean, None)
self.assertEqual('http://localhost/', f.clean('http://localhost'))
@@ -690,6 +691,7 @@ class FieldsTests(SimpleTestCase):
def test_urlfield_5(self):
f = URLField(min_length=15, max_length=20)
+ self.assertWidgetRendersTo(f, '<input id="id_f" type="url" name="f" maxlength="20" />')
self.assertRaisesMessage(ValidationError, "'Ensure this value has at least 15 characters (it has 13).'", f.clean, 'http://f.com')
self.assertEqual('http://example.com/', f.clean('http://example.com'))
self.assertRaisesMessage(ValidationError, "'Ensure this value has at most 20 characters (it has 38).'", f.clean, 'http://abcdefghijklmnopqrstuvwxyz.com')