mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user