Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed deprecated URLField.verify_exists.

The deprecation schedule was slightly accelerated because of possible security ramifications.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9ed6e08ff99c18710c0e4875f827235f04c89d76 1 parent 800e394
Aymeric Augustin authored March 31, 2012
5  django/conf/global_settings.py
@@ -403,11 +403,6 @@
403 403
 # Hint: you really don't!
404 404
 TRANSACTIONS_MANAGED = False
405 405
 
406  
-# The User-Agent string to use when checking for URL validity through the
407  
-# isExistingURL validator.
408  
-from django import get_version
409  
-URL_VALIDATOR_USER_AGENT = "Django/%s (https://www.djangoproject.com)" % get_version()
410  
-
411 406
 # The tablespaces to use for each model when not specified otherwise.
412 407
 DEFAULT_TABLESPACE = ''
413 408
 DEFAULT_INDEX_TABLESPACE = ''
66  django/core/validators.py
... ...
@@ -1,6 +1,4 @@
1 1
 import re
2  
-import urllib
3  
-import urllib2
4 2
 import urlparse
5 3
 
6 4
 from django.core.exceptions import ValidationError
@@ -11,13 +9,6 @@
11 9
 # These values, if given to validate(), will trigger the self.required check.
12 10
 EMPTY_VALUES = (None, '', [], (), {})
13 11
 
14  
-try:
15  
-    from django.conf import settings
16  
-    URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
17  
-except ImportError:
18  
-    # It's OK if Django settings aren't configured.
19  
-    URL_VALIDATOR_USER_AGENT = 'Django (http://www.djangoproject.com/)'
20  
-
21 12
 class RegexValidator(object):
22 13
     regex = ''
23 14
     message = _(u'Enter a valid value.')
@@ -51,11 +42,8 @@ class URLValidator(RegexValidator):
51 42
         r'(?::\d+)?' # optional port
52 43
         r'(?:/?|[/?]\S+)$', re.IGNORECASE)
53 44
 
54  
-    def __init__(self, verify_exists=False,
55  
-                 validator_user_agent=URL_VALIDATOR_USER_AGENT):
  45
+    def __init__(self):
56 46
         super(URLValidator, self).__init__()
57  
-        self.verify_exists = verify_exists
58  
-        self.user_agent = validator_user_agent
59 47
 
60 48
     def __call__(self, value):
61 49
         try:
@@ -76,58 +64,6 @@ def __call__(self, value):
76 64
         else:
77 65
             url = value
78 66
 
79  
-        if self.verify_exists:
80  
-            import warnings
81  
-            warnings.warn(
82  
-                "The URLField verify_exists argument has intractable security "
83  
-                "and performance issues. Accordingly, it has been deprecated.",
84  
-                DeprecationWarning
85  
-                )
86  
-
87  
-            headers = {
88  
-                "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
89  
-                "Accept-Language": "en-us,en;q=0.5",
90  
-                "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
91  
-                "Connection": "close",
92  
-                "User-Agent": self.user_agent,
93  
-            }
94  
-            url = url.encode('utf-8')
95  
-            # Quote characters from the unreserved set, refs #16812
96  
-            url = urllib.quote(url, "!*'();:@&=+$,/?#[]")
97  
-            broken_error = ValidationError(
98  
-                _(u'This URL appears to be a broken link.'), code='invalid_link')
99  
-            try:
100  
-                req = urllib2.Request(url, None, headers)
101  
-                req.get_method = lambda: 'HEAD'
102  
-                #Create an opener that does not support local file access
103  
-                opener = urllib2.OpenerDirector()
104  
-
105  
-                #Don't follow redirects, but don't treat them as errors either
106  
-                error_nop = lambda *args, **kwargs: True
107  
-                http_error_processor = urllib2.HTTPErrorProcessor()
108  
-                http_error_processor.http_error_301 = error_nop
109  
-                http_error_processor.http_error_302 = error_nop
110  
-                http_error_processor.http_error_307 = error_nop
111  
-
112  
-                handlers = [urllib2.UnknownHandler(),
113  
-                            urllib2.HTTPHandler(),
114  
-                            urllib2.HTTPDefaultErrorHandler(),
115  
-                            urllib2.FTPHandler(),
116  
-                            http_error_processor]
117  
-                try:
118  
-                    import ssl
119  
-                except ImportError:
120  
-                    # Python isn't compiled with SSL support
121  
-                    pass
122  
-                else:
123  
-                    handlers.append(urllib2.HTTPSHandler())
124  
-                map(opener.add_handler, handlers)
125  
-                opener.open(req, timeout=10)
126  
-            except ValueError:
127  
-                raise ValidationError(_(u'Enter a valid URL.'), code='invalid')
128  
-            except: # urllib2.URLError, httplib.InvalidURL, etc.
129  
-                raise broken_error
130  
-
131 67
 
132 68
 def validate_integer(value):
133 69
     try:
8  django/db/models/fields/__init__.py
@@ -890,7 +890,7 @@ class EmailField(CharField):
890 890
     description = _("E-mail address")
891 891
 
892 892
     def __init__(self, *args, **kwargs):
893  
-        # max_length should be overridden to 254 characters to be fully 
  893
+        # max_length should be overridden to 254 characters to be fully
894 894
         # compliant with RFCs 3696 and 5321
895 895
 
896 896
         kwargs['max_length'] = kwargs.get('max_length', 75)
@@ -1251,12 +1251,10 @@ def formfield(self, **kwargs):
1251 1251
 class URLField(CharField):
1252 1252
     description = _("URL")
1253 1253
 
1254  
-    def __init__(self, verbose_name=None, name=None, verify_exists=False,
1255  
-                 **kwargs):
  1254
+    def __init__(self, verbose_name=None, name=None, **kwargs):
1256 1255
         kwargs['max_length'] = kwargs.get('max_length', 200)
1257 1256
         CharField.__init__(self, verbose_name, name, **kwargs)
1258  
-        self.validators.append(
1259  
-            validators.URLValidator(verify_exists=verify_exists))
  1257
+        self.validators.append(validators.URLValidator())
1260 1258
 
1261 1259
     def formfield(self, **kwargs):
1262 1260
         # As with CharField, this will cause URL validation to be performed
9  django/forms/fields.py
@@ -598,14 +598,11 @@ def to_python(self, data):
598 598
 class URLField(CharField):
599 599
     default_error_messages = {
600 600
         'invalid': _(u'Enter a valid URL.'),
601  
-        'invalid_link': _(u'This URL appears to be a broken link.'),
602 601
     }
603 602
 
604  
-    def __init__(self, max_length=None, min_length=None, verify_exists=False,
605  
-            validator_user_agent=validators.URL_VALIDATOR_USER_AGENT, *args, **kwargs):
606  
-        super(URLField, self).__init__(max_length, min_length, *args,
607  
-                                       **kwargs)
608  
-        self.validators.append(validators.URLValidator(verify_exists=verify_exists, validator_user_agent=validator_user_agent))
  603
+    def __init__(self, max_length=None, min_length=None, *args, **kwargs):
  604
+        super(URLField, self).__init__(max_length, min_length, *args, **kwargs)
  605
+        self.validators.append(validators.URLValidator())
609 606
 
610 607
     def to_python(self, value):
611 608
 
16  docs/ref/forms/fields.txt
@@ -789,7 +789,7 @@ For each field, we describe the default widget used if you don't specify
789 789
     * Empty value: ``''`` (an empty string)
790 790
     * Normalizes to: A Unicode object.
791 791
     * Validates that the given value is a valid URL.
792  
-    * Error message keys: ``required``, ``invalid``, ``invalid_link``
  792
+    * Error message keys: ``required``, ``invalid``
793 793
 
794 794
     Takes the following optional arguments:
795 795
 
@@ -798,20 +798,6 @@ For each field, we describe the default widget used if you don't specify
798 798
 
799 799
     These are the same as ``CharField.max_length`` and ``CharField.min_length``.
800 800
 
801  
-    .. attribute:: verify_exists
802  
-
803  
-        If ``True``, the validator will attempt to load the given URL, raising
804  
-        ``ValidationError`` if the page gives a 404. Defaults to ``False``.
805  
-
806  
-        .. deprecated:: 1.4
807  
-            ``verify_exists`` was deprecated for security reasons and will be removed in
808  
-            Django 1.5. This deprecation also removes ``validator_user_agent``.
809  
-
810  
-    .. attribute:: validator_user_agent
811  
-
812  
-        String used as the user-agent used when checking for a URL's existence.
813  
-        Defaults to the value of the :setting:`URL_VALIDATOR_USER_AGENT` setting.
814  
-
815 801
 .. versionchanged:: 1.2
816 802
    The URLField previously did not recognize URLs as valid that contained an IDN
817 803
    (Internationalized Domain Name; a domain name containing unicode characters)
26  docs/ref/models/fields.txt
@@ -484,10 +484,10 @@ A :class:`CharField` that checks that the value is a valid email address.
484 484
 .. admonition:: Incompliance to RFCs
485 485
 
486 486
     The default 75 character ``max_length`` is not capable of storing all
487  
-    possible RFC3696/5321-compliant email addresses. In order to store all 
488  
-    possible valid email addresses, a ``max_length`` of 254 is required. 
489  
-    The default ``max_length`` of 75 exists for historical reasons. The 
490  
-    default has not been changed in order to maintain backwards 
  487
+    possible RFC3696/5321-compliant email addresses. In order to store all
  488
+    possible valid email addresses, a ``max_length`` of 254 is required.
  489
+    The default ``max_length`` of 75 exists for historical reasons. The
  490
+    default has not been changed in order to maintain backwards
491 491
     compatibility with existing uses of :class:`EmailField`.
492 492
 
493 493
 ``FileField``
@@ -887,23 +887,9 @@ shortcuts.
887 887
 ``URLField``
888 888
 ------------
889 889
 
890  
-.. class:: URLField([verify_exists=False, max_length=200, **options])
  890
+.. class:: URLField([max_length=200, **options])
891 891
 
892  
-A :class:`CharField` for a URL. Has one extra optional argument:
893  
-
894  
-.. deprecated:: 1.4
895  
-   ``verify_exists`` is deprecated for security reasons as of 1.4 and will be
896  
-   removed in Django 1.5. Prior to 1.3.1, the default value was ``True``.
897  
-
898  
-.. attribute:: URLField.verify_exists
899  
-
900  
-    If ``True``, the URL given will be checked for existence (i.e.,
901  
-    the URL actually loads and doesn't give a 404 response) using a
902  
-    ``HEAD`` request. Redirects are allowed, but will not be followed.
903  
-
904  
-    Note that when you're using the single-threaded development server,
905  
-    validating a URL being served by the same server will hang. This should not
906  
-    be a problem for multithreaded servers.
  892
+A :class:`CharField` for a URL.
907 893
 
908 894
 The admin represents this as an ``<input type="text">`` (a single-line input).
909 895
 
21  docs/ref/settings.txt
@@ -2148,18 +2148,6 @@ to ensure your processes are running in the correct environment.
2148 2148
 
2149 2149
 .. _pytz: http://pytz.sourceforge.net/
2150 2150
 
2151  
-.. setting:: URL_VALIDATOR_USER_AGENT
2152  
-
2153  
-URL_VALIDATOR_USER_AGENT
2154  
-------------------------
2155  
-
2156  
-Default: ``Django/<version> (https://www.djangoproject.com/)``
2157  
-
2158  
-The string to use as the ``User-Agent`` header when checking to see if
2159  
-URLs exist (see the ``verify_exists`` option on
2160  
-:class:`~django.db.models.URLField`). This setting was deprecated in
2161  
-1.3.1 along with ``verify_exists`` and will be removed in 1.4.
2162  
-
2163 2151
 .. setting:: USE_ETAGS
2164 2152
 
2165 2153
 USE_ETAGS
@@ -2344,3 +2332,12 @@ IGNORABLE_404_STARTS
2344 2332
 
2345 2333
 .. deprecated:: 1.4
2346 2334
    This setting has been superseded by :setting:`IGNORABLE_404_URLS`.
  2335
+
  2336
+.. setting:: URL_VALIDATOR_USER_AGENT
  2337
+
  2338
+URL_VALIDATOR_USER_AGENT
  2339
+------------------------
  2340
+
  2341
+.. deprecated:: 1.5
  2342
+    This value was used as the ``User-Agent`` header when checking if a URL
  2343
+    exists, a feature that was removed due to security and performance issues.
22  docs/ref/validators.txt
@@ -88,26 +88,10 @@ to, or in lieu of custom ``field.clean()`` methods.
88 88
 
89 89
 ``URLValidator``
90 90
 ----------------
91  
-.. class:: URLValidator([verify_exists=False, validator_user_agent=URL_VALIDATOR_USER_AGENT])
  91
+.. class:: URLValidator()
92 92
 
93  
-    A :class:`RegexValidator` that ensures a value looks like a URL and
94  
-    optionally verifies that the URL actually exists (i.e., doesn't return a
95  
-    404 status code). Raises an error code of ``'invalid'`` if it doesn't look
96  
-    like a URL, and a code of ``'invalid_link'`` if it doesn't exist.
97  
-
98  
-    :param verify_exists: Sets :attr:`verify_exists`. Defaults to ``False``.
99  
-    :param validator_user_agent: Sets :attr:`validator_user_agent`. Defaults to
100  
-        :setting:`URL_VALIDATOR_USER_AGENT` or, if that setting is set to a
101  
-        null value, ``"Django (https://www.djangoproject.com/)"``.
102  
-
103  
-    .. attribute:: verify_exists
104  
-
105  
-        If set to ``True``, this validator checks that the URL actually exists.
106  
-
107  
-    .. attribute:: validator_user_agent
108  
-
109  
-        If :attr:`verify_exists` is ``True``, Django uses this value as the
110  
-        "User-agent" for the request.
  93
+    A :class:`RegexValidator` that ensures a value looks like a URL, and raises
  94
+    an error code of ``'invalid'`` if it doesn't.
111 95
 
112 96
 ``validate_email``
113 97
 ------------------
3  docs/topics/forms/modelforms.txt
@@ -106,8 +106,7 @@ Model field                      Form field
106 106
 
107 107
 ``TimeField``                    ``TimeField``
108 108
 
109  
-``URLField``                     ``URLField`` with ``verify_exists`` set
110  
-                                 to the model field's ``verify_exists``
  109
+``URLField``                     ``URLField``
111 110
 ===============================  ========================================
112 111
 
113 112
 .. versionadded:: 1.2
3  tests/modeltests/validation/models.py
@@ -15,7 +15,6 @@ class ModelToValidate(models.Model):
15 15
     parent = models.ForeignKey('self', blank=True, null=True, limit_choices_to={'number': 10})
16 16
     email = models.EmailField(blank=True)
17 17
     url = models.URLField(blank=True)
18  
-    url_verify = models.URLField(blank=True, verify_exists=True)
19 18
     f_with_custom_validator = models.IntegerField(blank=True, null=True, validators=[validate_answer_to_universe])
20 19
 
21 20
     def clean(self):
@@ -102,4 +101,4 @@ class MultipleAutoFields(models.Model):
102 101
         auto2 = models.AutoField(primary_key=True)
103 102
 except AssertionError, assertion_error:
104 103
     pass # Fail silently
105  
-assert str(assertion_error) == u"A model can't have more than one AutoField."
  104
+assert str(assertion_error) == u"A model can't have more than one AutoField."
32  tests/modeltests/validation/tests.py
... ...
@@ -1,14 +1,9 @@
1 1
 from __future__ import absolute_import
2 2
 
3  
-import warnings
4  
-
5 3
 from django import forms
6 4
 from django.core.exceptions import NON_FIELD_ERRORS
7 5
 from django.test import TestCase
8 6
 
9  
-# Import the verify_exists_urls from the 'forms' test app
10  
-from regressiontests.forms.tests.fields import verify_exists_urls
11  
-
12 7
 from . import ValidationTestCase
13 8
 from .models import (Author, Article, ModelToValidate,
14 9
     GenericIPAddressTestModel, GenericIPAddrUnpackUniqueTest)
@@ -22,14 +17,6 @@
22 17
 
23 18
 class BaseModelValidationTests(ValidationTestCase):
24 19
 
25  
-    def setUp(self):
26  
-        self.save_warnings_state()
27  
-        warnings.filterwarnings('ignore', category=DeprecationWarning,
28  
-                                module='django.core.validators')
29  
-
30  
-    def tearDown(self):
31  
-        self.restore_warnings_state()
32  
-
33 20
     def test_missing_required_field_raises_error(self):
34 21
         mtv = ModelToValidate(f_with_custom_validator=42)
35 22
         self.assertFailsValidation(mtv.full_clean, ['name', 'number'])
@@ -70,25 +57,6 @@ def test_wrong_url_value_raises_error(self):
70 57
         mtv = ModelToValidate(number=10, name='Some Name', url='not a url')
71 58
         self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', [u'Enter a valid value.'])
72 59
 
73  
-    #The tests below which use url_verify are deprecated
74  
-    def test_correct_url_but_nonexisting_gives_404(self):
75  
-        mtv = ModelToValidate(number=10, name='Some Name', url_verify='http://qa-dev.w3.org/link-testsuite/http.php?code=404')
76  
-        self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url_verify', [u'This URL appears to be a broken link.'])
77  
-
78  
-    @verify_exists_urls(existing_urls=('http://www.google.com/',))
79  
-    def test_correct_url_value_passes(self):
80  
-        mtv = ModelToValidate(number=10, name='Some Name', url_verify='http://www.google.com/')
81  
-        self.assertEqual(None, mtv.full_clean()) # This will fail if there's no Internet connection
82  
-
83  
-    @verify_exists_urls(existing_urls=('http://qa-dev.w3.org/link-testsuite/http.php?code=301',))
84  
-    def test_correct_url_with_redirect(self):
85  
-        mtv = ModelToValidate(number=10, name='Some Name', url_verify='http://qa-dev.w3.org/link-testsuite/http.php?code=301') #example.com is a redirect to iana.org now
86  
-        self.assertEqual(None, mtv.full_clean()) # This will fail if there's no Internet connection
87  
-
88  
-    def test_correct_https_url_but_nonexisting(self):
89  
-        mtv = ModelToValidate(number=10, name='Some Name', url_verify='https://www.example.com/')
90  
-        self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url_verify', [u'This URL appears to be a broken link.'])
91  
-
92 60
     def test_text_greater_that_charfields_max_length_raises_erros(self):
93 61
         mtv = ModelToValidate(number=10, name='Some Name'*100)
94 62
         self.assertFailsValidation(mtv.full_clean, ['name',])
7  tests/regressiontests/forms/tests/error_messages.py
@@ -7,8 +7,6 @@
7 7
 from django.test import TestCase
8 8
 from django.utils.safestring import mark_safe
9 9
 
10  
-from .fields import verify_exists_urls
11  
-
12 10
 
13 11
 class AssertFormErrorsMixin(object):
14 12
     def assertFormErrors(self, expected, the_callable, *args, **kwargs):
@@ -143,17 +141,14 @@ def test_filefield(self):
143 141
         self.assertFormErrors([u'EMPTY FILE'], f.clean, SimpleUploadedFile('name', None))
144 142
         self.assertFormErrors([u'EMPTY FILE'], f.clean, SimpleUploadedFile('name', ''))
145 143
 
146  
-    @verify_exists_urls()
147 144
     def test_urlfield(self):
148 145
         e = {
149 146
             'required': 'REQUIRED',
150 147
             'invalid': 'INVALID',
151  
-            'invalid_link': 'INVALID LINK',
152 148
         }
153  
-        f = URLField(verify_exists=True, error_messages=e)
  149
+        f = URLField(error_messages=e)
154 150
         self.assertFormErrors([u'REQUIRED'], f.clean, '')
155 151
         self.assertFormErrors([u'INVALID'], f.clean, 'abc.c')
156  
-        self.assertFormErrors([u'INVALID LINK'], f.clean, 'http://www.broken.djangoproject.com')
157 152
 
158 153
     def test_booleanfield(self):
159 154
         e = {
61  tests/regressiontests/forms/tests/fields.py
@@ -27,10 +27,8 @@
27 27
 import datetime
28 28
 import re
29 29
 import os
30  
-import urllib2
31 30
 import warnings
32 31
 from decimal import Decimal
33  
-from functools import wraps
34 32
 
35 33
 from django.core.files.uploadedfile import SimpleUploadedFile
36 34
 from django.forms import *
@@ -48,32 +46,6 @@ def fix_os_paths(x):
48 46
         return x
49 47
 
50 48
 
51  
-def verify_exists_urls(existing_urls=()):
52  
-    """
53  
-    Patches urllib to simulate the availability of some urls even when there
54  
-    is no Internet connection. This hack should be removed alongside with
55  
-    `URLField.verify_exists` in Django 1.5.
56  
-    """
57  
-    def decorator(func):
58  
-        @wraps(func)
59  
-        def wrapper(*args, **kwargs):
60  
-            from django.core import validators
61  
-            # patch urllib2.OpenerDirector
62  
-            original_open = validators.urllib2.OpenerDirector.open
63  
-            def custom_open(self, req, data=None, timeout=None):
64  
-                if req.get_full_url() in existing_urls:
65  
-                    return True
66  
-                raise Exception()
67  
-            try:
68  
-                urllib2.OpenerDirector.open = custom_open
69  
-                func(*args, **kwargs)
70  
-            finally:
71  
-                # unpatch urllib2.OpenerDirector
72  
-                validators.urllib2.OpenerDirector.open = original_open
73  
-        return wrapper
74  
-    return decorator
75  
-
76  
-
77 49
 class FieldsTests(SimpleTestCase):
78 50
 
79 51
     def setUp(self):
@@ -651,30 +623,6 @@ def test_urlfield_2(self):
651 623
         self.assertRaisesMessage(ValidationError, "[u'Enter a valid URL.']", f.clean, 'http://example.')
652 624
         self.assertRaisesMessage(ValidationError, "[u'Enter a valid URL.']", f.clean, 'http://.com')
653 625
 
654  
-    @verify_exists_urls(('http://www.google.com/',))
655  
-    def test_urlfield_3(self):
656  
-        f = URLField(verify_exists=True)
657  
-        self.assertEqual(u'http://www.google.com/', f.clean('http://www.google.com'))
658  
-        self.assertRaisesMessage(ValidationError, "[u'Enter a valid URL.']", f.clean, 'http://example')
659  
-        self.assertRaises(ValidationError, f.clean, 'http://www.broken.djangoproject.com') # bad domain
660  
-        self.assertRaises(ValidationError, f.clean, 'http://qa-dev.w3.org/link-testsuite/http.php?code=405') # Method not allowed
661  
-        try:
662  
-            f.clean('http://www.broken.djangoproject.com') # bad domain
663  
-        except ValidationError, e:
664  
-            self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
665  
-        self.assertRaises(ValidationError, f.clean, 'http://qa-dev.w3.org/link-testsuite/http.php?code=400') # good domain, bad page
666  
-        try:
667  
-            f.clean('http://google.com/we-love-microsoft.html') # good domain, bad page
668  
-        except ValidationError, e:
669  
-            self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
670  
-
671  
-    @verify_exists_urls(('http://www.google.com/',))
672  
-    def test_urlfield_4(self):
673  
-        f = URLField(verify_exists=True, required=False)
674  
-        self.assertEqual(u'', f.clean(''))
675  
-        self.assertEqual(u'http://www.google.com/', f.clean('http://www.google.com'))
676  
-
677  
-    @verify_exists_urls(('http://example.com/',))
678 626
     def test_urlfield_5(self):
679 627
         f = URLField(min_length=15, max_length=20)
680 628
         self.assertRaisesMessage(ValidationError, "[u'Ensure this value has at least 15 characters (it has 13).']", f.clean, 'http://f.com')
@@ -698,7 +646,7 @@ def test_urlfield_8(self):
698 646
         self.assertEqual(u'http://example.com/?some_param=some_value', f.clean('http://example.com?some_param=some_value'))
699 647
 
700 648
     def test_urlfield_9(self):
701  
-        f = URLField(verify_exists=False)
  649
+        f = URLField()
702 650
         urls = (
703 651
             u'http://עברית.idn.icann.org/',
704 652
             u'http://sãopaulo.com/',
@@ -722,13 +670,6 @@ def test_urlfield_9(self):
722 670
         except ValidationError, e:
723 671
             self.assertEqual("[u'This URL appears to be a broken link.']", str(e))
724 672
 
725  
-    @verify_exists_urls((u'http://xn--hxargifdar.idn.icann.org/%CE%91%CF%81%CF%87%CE%B9%CE%BA%CE%AE_%CF%83%CE%B5%CE%BB%CE%AF%CE%B4%CE%B1',))
726  
-    def test_urlfield_10(self):
727  
-        # UTF-8 in the domain.
728  
-        f = URLField(verify_exists=True)
729  
-        url = u'http://\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac.idn.icann.org/\u0391\u03c1\u03c7\u03b9\u03ba\u03ae_\u03c3\u03b5\u03bb\u03af\u03b4\u03b1'
730  
-        self.assertEqual(url, f.clean(url))
731  
-
732 673
     def test_urlfield_not_string(self):
733 674
         f = URLField(required=False)
734 675
         self.assertRaisesMessage(ValidationError, "[u'Enter a valid URL.']", f.clean, 23)
2  tests/regressiontests/generic_inline_admin/models.py
@@ -16,7 +16,7 @@ class Media(models.Model):
16 16
     content_type = models.ForeignKey(ContentType)
17 17
     object_id = models.PositiveIntegerField()
18 18
     content_object = generic.GenericForeignKey()
19  
-    url = models.URLField(verify_exists=False)
  19
+    url = models.URLField()
20 20
     description = models.CharField(max_length=100, blank=True)
21 21
     keywords = models.CharField(max_length=100, blank=True)
22 22
 
2  tests/regressiontests/model_forms_regress/models.py
@@ -57,7 +57,7 @@ class Author1(models.Model):
57 57
     full_name = models.CharField(max_length=255)
58 58
 
59 59
 class Homepage(models.Model):
60  
-    url = models.URLField(verify_exists=False)
  60
+    url = models.URLField()
61 61
 
62 62
 class Document(models.Model):
63 63
     myfile = models.FileField(upload_to='unused', blank=True)

0 notes on commit 9ed6e08

Please sign in to comment.
Something went wrong with that request. Please try again.