summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-09-14 07:02:55 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-09-14 07:02:55 +0000
commit20ecbbd9e749f7abd0a7ffcc61b01cb874846817 (patch)
treeeb2f50239c971bb0665ef3c4ca4ba1bdbac6d58f /tests/regressiontests/forms
parent3358e2fec701fc7523e126433c87428e7a540b5f (diff)
Fiex #5331 -- Modified newforms URLField to prepend http:// if no protocol is specified by the user. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/tests.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index 2cbe5a4400..fef8361a14 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -1623,10 +1623,6 @@ u'http://200.8.9.10:8000/test'
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid URL.']
->>> f.clean('example.com')
-Traceback (most recent call last):
-...
-ValidationError: [u'Enter a valid URL.']
>>> f.clean('http://')
Traceback (most recent call last):
...
@@ -1657,10 +1653,6 @@ u'http://www.example.com'
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid URL.']
->>> f.clean('example.com')
-Traceback (most recent call last):
-...
-ValidationError: [u'Enter a valid URL.']
>>> f.clean('http://')
Traceback (most recent call last):
...
@@ -1714,6 +1706,15 @@ Traceback (most recent call last):
...
ValidationError: [u'Ensure this value has at most 20 characters (it has 37).']
+URLField should prepend 'http://' if no scheme was given
+>>> f = URLField(required=False)
+>>> f.clean('example.com')
+u'http://example.com'
+>>> f.clean('')
+u''
+>>> f.clean('https://example.com')
+u'https://example.com'
+
# BooleanField ################################################################
>>> f = BooleanField()