91 lines
3.5 KiB
Diff
91 lines
3.5 KiB
Diff
|
From: Stefano Rivera <stefanor@debian.org>
|
||
|
Date: Sun, 11 Oct 2015 22:20:17 +0200
|
||
|
Subject: remove-dns-tests.diff
|
||
|
|
||
|
Tests that require network (DNS) access
|
||
|
Patch-Name: remove-dns-tests.diff
|
||
|
---
|
||
|
formencode/validators.py | 30 ------------------------------
|
||
|
1 file changed, 30 deletions(-)
|
||
|
|
||
|
diff --git a/formencode/validators.py b/formencode/validators.py
|
||
|
index c332ec9..cfba7c8 100644
|
||
|
--- a/formencode/validators.py
|
||
|
+++ b/formencode/validators.py
|
||
|
@@ -1288,20 +1288,6 @@ class Email(FancyValidator):
|
||
|
'nobody@xn--m7r7ml7t24h.com'
|
||
|
>>> e.to_python('o*reilly@test.com')
|
||
|
'o*reilly@test.com'
|
||
|
- >>> e = Email(resolve_domain=True)
|
||
|
- >>> e.resolve_domain
|
||
|
- True
|
||
|
- >>> e.to_python('doesnotexist@colorstudy.com')
|
||
|
- 'doesnotexist@colorstudy.com'
|
||
|
- >>> e.to_python('test@nyu.edu')
|
||
|
- 'test@nyu.edu'
|
||
|
- >>> # NOTE: If you do not have dnspython installed this example won't work:
|
||
|
- >>> e.to_python('test@thisdomaindoesnotexistithinkforsure.com')
|
||
|
- Traceback (most recent call last):
|
||
|
- ...
|
||
|
- Invalid: The domain of the email address does not exist (the portion after the @: thisdomaindoesnotexistithinkforsure.com)
|
||
|
- >>> e.to_python(u'test@google.com')
|
||
|
- u'test@google.com'
|
||
|
>>> e = Email(not_empty=False)
|
||
|
>>> e.to_python('')
|
||
|
|
||
|
@@ -1429,22 +1415,6 @@ class URL(FancyValidator):
|
||
|
Traceback (most recent call last):
|
||
|
...
|
||
|
Invalid: That is not a valid URL
|
||
|
- >>> u = URL(add_http=False, check_exists=True)
|
||
|
- >>> u.to_python('http://google.com')
|
||
|
- 'http://google.com'
|
||
|
- >>> u.to_python('google.com')
|
||
|
- Traceback (most recent call last):
|
||
|
- ...
|
||
|
- Invalid: You must start your URL with http://, https://, etc
|
||
|
- >>> u.to_python('http://www.formencode.org/does/not/exist/page.html')
|
||
|
- Traceback (most recent call last):
|
||
|
- ...
|
||
|
- Invalid: The server responded that the page could not be found
|
||
|
- >>> u.to_python('http://this.domain.does.not.exist.example.org/test.html')
|
||
|
- ... # doctest: +ELLIPSIS
|
||
|
- Traceback (most recent call last):
|
||
|
- ...
|
||
|
- Invalid: An error occured when trying to connect to the server: ...
|
||
|
|
||
|
If you want to allow addresses without a TLD (e.g., ``localhost``) you can do::
|
||
|
|
||
|
From: "drnlmuller+debian@gmail.com" <drnlmuller+debian@gmail.com>
|
||
|
Date: Tue, 14 Jun 2016 14:40:12 +0200
|
||
|
Subject: Remove tests from test_email that require dns.
|
||
|
|
||
|
Some of the new tests in test_email also require dns. This patch
|
||
|
removes them so the build does not require network access.
|
||
|
---
|
||
|
formencode/tests/test_email.py | 14 --------------
|
||
|
1 file changed, 14 deletions(-)
|
||
|
|
||
|
diff --git a/formencode/tests/test_email.py b/formencode/tests/test_email.py
|
||
|
index 3ebf120..2305454 100644
|
||
|
--- a/formencode/tests/test_email.py
|
||
|
+++ b/formencode/tests/test_email.py
|
||
|
@@ -65,17 +65,3 @@ class TestEmail(unittest.TestCase):
|
||
|
|
||
|
for email, expected in valid_email_addresses:
|
||
|
self.assertEqual(self.validate(email), expected)
|
||
|
-
|
||
|
-
|
||
|
-class TestUnicodeEmailWithResolveDomain(unittest.TestCase):
|
||
|
-
|
||
|
- def setUp(self):
|
||
|
- self.validator = Email(resolve_domain=True)
|
||
|
-
|
||
|
- def test_unicode_ascii_subgroup(self):
|
||
|
- self.assertEqual(self.validator.to_python(
|
||
|
- u'foo@yandex.com'), 'foo@yandex.com')
|
||
|
-
|
||
|
- def test_cyrillic_email(self):
|
||
|
- self.assertEqual(self.validator.to_python(
|
||
|
- u'me@письмо.рф'), u'me@письмо.рф')
|