[Python-modules-commits] [sorl-thumbnail] 08/17: Disable HTTP requests during build
Wolfgang Borgert
debacle at moszumanska.debian.org
Wed Jan 6 21:05:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch master
in repository sorl-thumbnail.
commit 5ec2035a62b75066218e8af21dc920e413a8a7f2
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Thu Oct 8 13:53:16 2015 -0700
Disable HTTP requests during build
Remote resources such as images fetched over HTTP are not allowed at build
time so this patch skips these tests if the environment variable
LOCAL_BUILD is present.
Last-Update: 2015-01-27
Forwarded: not-needed
Patch-Name: disable_http_tests.patch
---
tests/thumbnail_tests/test_engines.py | 13 +++++++------
tests/thumbnail_tests/test_templatetags.py | 2 ++
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/thumbnail_tests/test_engines.py b/tests/thumbnail_tests/test_engines.py
index 3b60b33..6bc0e82 100644
--- a/tests/thumbnail_tests/test_engines.py
+++ b/tests/thumbnail_tests/test_engines.py
@@ -190,12 +190,13 @@ class SimpleTestCase(BaseTestCase):
default.kvstore.get(im).serialize_storage(),
'tests.thumbnail_tests.storage.TestStorage',
)
- im = ImageFile('http://dummyimage.com/300x300/')
- default.kvstore.set(im)
- self.assertEqual(
- default.kvstore.get(im).serialize_storage(),
- 'sorl.thumbnail.images.UrlStorage',
- )
+ if not os.environ.get('LOCAL_BUILD', False):
+ im = ImageFile('http://dummyimage.com/300x300/')
+ default.kvstore.set(im)
+ self.assertEqual(
+ default.kvstore.get(im).serialize_storage(),
+ 'sorl.thumbnail.images.UrlStorage',
+ )
def test_abspath(self):
item = Item.objects.get(image='500x500.jpg')
diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
index d545519..0dbef1e 100644
--- a/tests/thumbnail_tests/test_templatetags.py
+++ b/tests/thumbnail_tests/test_templatetags.py
@@ -146,10 +146,12 @@ class TemplateTestCaseA(BaseTestCase):
class TemplateTestCaseB(BaseTestCase):
+ @unittest.skipIf(os.environ.get('LOCAL_BUILD', False), "No remote resources desired")
def test_url(self):
val = render_to_string('thumbnail3.html', {}).strip()
self.assertEqual(val, '<img style="margin:0px 0px 0px 0px" width="20" height="20">')
+ @unittest.skipIf(os.environ.get('LOCAL_BUILD', False), "No remote resources desired")
def test_portrait(self):
val = render_to_string('thumbnail4.html', {
'source': 'http://dummyimage.com/120x100/',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sorl-thumbnail.git
More information about the Python-modules-commits
mailing list