summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-02-28 12:01:18 +0000
committerJannis Leidel <jannis@leidel.info>2010-02-28 12:01:18 +0000
commit68f216a6925e5e0d78e499157b2c2a261bb7f24c (patch)
treea448420894b281403e27ef80235740e3ac89aab6 /tests/regressiontests/forms
parentd7abb33e70cf91c983b997cbeafbea2cd0371762 (diff)
Fixed #12989 - Fixed verification of IDN URLs. Thanks to Fraser Nevett for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/fields.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py
index 0c7493ee67..eb85a05d21 100644
--- a/tests/regressiontests/forms/fields.py
+++ b/tests/regressiontests/forms/fields.py
@@ -531,6 +531,13 @@ class FieldsTests(TestCase):
f.clean('http://google.com/we-love-microsoft.html') # good domain, bad page
except ValidationError, e:
self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
+ # Valid and existent IDN
+ self.assertEqual(u'http://\u05e2\u05d1\u05e8\u05d9\u05ea.idn.icann.org/', f.clean(u'http://עברית.idn.icann.org/'))
+ # Valid but non-existent IDN
+ try:
+ f.clean(u'http://broken.עברית.idn.icann.org/')
+ except ValidationError, e:
+ self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
def test_urlfield_40(self):
f = URLField(verify_exists=True, required=False)