summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-01-13 05:19:15 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-01-13 05:19:15 +0000
commitf2a3deb0871c6cdbe04e1e0b36f4984c7c825bac (patch)
tree2dd0966a04584a4ea90d90472f8f550d018613b8 /tests
parent6b31f95516e3a65f93a9ab6491c6e3b2b54ae620 (diff)
Fixed #3281 -- newforms: URLField now works properly with required=False and verify_exists=True together. Thanks, zendak
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4313 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/forms/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index bfe36a467e..2ae10dc0d6 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -1331,6 +1331,11 @@ ValidationError: [u'This URL appears to be a broken link.']
Traceback (most recent call last):
...
ValidationError: [u'This URL appears to be a broken link.']
+>>> f = URLField(verify_exists=True, required=False)
+>>> f.clean('')
+u''
+>>> f.clean('http://www.google.com') # This will fail if there's no Internet connection
+u'http://www.google.com'
EmailField also access min_length and max_length parameters, for convenience.
>>> f = URLField(min_length=15, max_length=20)