Commit ba1876ce authored by Jannis Leidel's avatar Jannis Leidel
Browse files

Fixed #14941 -- Stop raising ValidationError in form fields that use the...

Fixed #14941 -- Stop raising ValidationError in form fields that use the URLValidator and get a IDN domain passed. Thanks, Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent bc5c2537
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ class URLValidator(RegexValidator):
                "Connection": "close",
                "User-Agent": self.user_agent,
            }
            url = url.encode('utf-8')
            broken_error = ValidationError(
                _(u'This URL appears to be a broken link.'), code='invalid_link')
            try:
+2 −0
Original line number Diff line number Diff line
@@ -571,6 +571,8 @@ 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))
        # UTF-8 char in path
        self.assertEqual(u'http://de.wikipedia.org/wiki/T\xfcr', f.clean(u'http://de.wikipedia.org/wiki/T\xfcr'))

    def test_urlfield_4(self):
        f = URLField(verify_exists=True, required=False)