[Python-modules-commits] [sorl-thumbnail] 08/15: unapply patches in master

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 5 01:39:42 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 74009481f1e83b573f19590566c783a6a57a068a
Author: W. Martin Borgert <debacle at debian.org>
Date:   Tue Oct 4 02:20:44 2016 +0200

    unapply patches in master
---
 tests/thumbnail_tests/compat.py            |  5 ----
 tests/thumbnail_tests/test_engines.py      | 18 +++++--------
 tests/thumbnail_tests/test_templatetags.py | 43 +++---------------------------
 3 files changed, 9 insertions(+), 57 deletions(-)

diff --git a/tests/thumbnail_tests/compat.py b/tests/thumbnail_tests/compat.py
index 10f26df..7367017 100644
--- a/tests/thumbnail_tests/compat.py
+++ b/tests/thumbnail_tests/compat.py
@@ -4,11 +4,6 @@ try:
     import unittest2 as unittest
 except ImportError:
     import unittest
-else:
-    try:
-        from django.utils import unittest
-    except ImportError:
-        import unittest
 
 
 def is_osx():
diff --git a/tests/thumbnail_tests/test_engines.py b/tests/thumbnail_tests/test_engines.py
index b4e1bc3..4ef4617 100644
--- a/tests/thumbnail_tests/test_engines.py
+++ b/tests/thumbnail_tests/test_engines.py
@@ -192,13 +192,12 @@ class SimpleTestCase(BaseTestCase):
             default.kvstore.get(im).serialize_storage(),
             'tests.thumbnail_tests.storage.TestStorage',
         )
-        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',
-            )
+        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')
@@ -344,11 +343,6 @@ class CropTestCase(BaseTestCase):
         self.assertEqual(th.x, 25)
         self.assertEqual(th.y, 50)
 
-    @unittest.skipIf(settings.THUMBNAIL_ENGINE in (
-        "sorl.thumbnail.engines.pgmagick_engine.Engine",
-        "sorl.thumbnail.engines.convert_engine.Engine",
-        ),
-        "graphicsmagick and pgmagick do not preserve ICC profile on crop")
     def test_crop_image_with_icc_profile(self):
         name = 'data/icc_profile_test.jpg'
         item, _ = Item.objects.get_or_create(image=name)
diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
index 557c2d2..c774dea 100644
--- a/tests/thumbnail_tests/test_templatetags.py
+++ b/tests/thumbnail_tests/test_templatetags.py
@@ -1,14 +1,11 @@
 # -*- coding: utf-8 -*-
 import os
 import re
-import shutil
-import unittest
 from subprocess import Popen, PIPE
 from PIL import Image
 
 from django.template.loader import render_to_string
 from django.test import Client, TestCase
-from django import VERSION
 import pytest
 
 from sorl.thumbnail.conf import settings
@@ -79,10 +76,8 @@ class TemplateTestCaseA(BaseTestCase):
         m = re.search('Interlace: None', str(p.stdout.read()))
         self.assertEqual(bool(m), True)
 
-    def test_orientation_pixels(self):
-        data_dir = os.path.join(settings.MEDIA_ROOT, 'data_pixels')
-        shutil.copytree(settings.DATA_ROOT, data_dir)
-        ref = Image.open(os.path.join(data_dir, '1_topleft.jpg'))
+    def test_orientation(self):
+        ref = Image.open(os.path.join(DATA_DIR, '1_topleft.jpg'))
         top = ref.getpixel((14, 7))
         left = ref.getpixel((7, 14))
         engine = PILEngine()
@@ -106,53 +101,22 @@ class TemplateTestCaseA(BaseTestCase):
         )
 
         for name in data_images:
-            th = self.BACKEND.get_thumbnail('data_pixels/%s' % name, '30x30')
+            th = self.BACKEND.get_thumbnail('data/%s' % name, '30x30')
             im = engine.get_image(th)
 
             self.assertLess(epsilon(top, im.getpixel((14, 7))), 10)
             self.assertLess(epsilon(left, im.getpixel((7, 14))), 10)
-
-        shutil.rmtree(data_dir)
-
-    @unittest.skipIf(settings.THUMBNAIL_ENGINE in (
-        "sorl.thumbnail.engines.pgmagick_engine.Engine",
-        "sorl.thumbnail.engines.convert_engine.Engine",
-        ),
-        "graphicsmagick and pgmagick do not correct the orientation in the EXIF tag")
-    def test_orientation_exif(self):
-        data_dir = os.path.join(settings.MEDIA_ROOT, 'data_exif')
-        shutil.copytree(settings.DATA_ROOT, data_dir)
-        engine = PILEngine()
-
-        data_images = (
-            '1_topleft.jpg',
-            '2_topright.jpg',
-            '3_bottomright.jpg',
-            '4_bottomleft.jpg',
-            '5_lefttop.jpg',
-            '6_righttop.jpg',
-            '7_rightbottom.jpg',
-            '8_leftbottom.jpg'
-        )
-
-        for name in sorted(os.listdir(data_dir)):
-            th = self.BACKEND.get_thumbnail('data_exif/%s' % name, '30x30')
-            im = engine.get_image(th)
             exif = im._getexif()
 
             if exif:
                 self.assertEqual(exif.get(0x0112), 1)
 
-        shutil.rmtree(data_dir)
-
 
 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/',
@@ -168,7 +132,6 @@ class TemplateTestCaseB(BaseTestCase):
 
 
 class TemplateTestCaseClient(TestCase):
-    @unittest.skipIf(VERSION[0] == 1 and VERSION[1] in [8, 9], "Test incompatible with Django 1.8/1.9")
     def test_empty_error(self):
         with override_custom_settings(settings, THUMBNAIL_DEBUG=False):
             from django.core.mail import outbox

-- 
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