1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
From 2301172c97b1680a811bfa99b6a869217d6785a8 Mon Sep 17 00:00:00 2001
From: "W. Martin Borgert" <debacle@debian.org>
Date: Wed, 6 Jan 2016 21:18:12 +0100
Subject: skip incompatible test for Django 1.8/1.9
---
tests/thumbnail_tests/compat.py | 5 ++++-
tests/thumbnail_tests/test_templatetags.py | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/thumbnail_tests/compat.py b/tests/thumbnail_tests/compat.py
index e1e1fba..21b08ed 100644
--- a/tests/thumbnail_tests/compat.py
+++ b/tests/thumbnail_tests/compat.py
@@ -8,7 +8,10 @@ PY3 = sys.version_info[0] == 3
if PY3:
import unittest
else:
- from django.utils import unittest
+ try:
+ from django.utils import unittest
+ except ImportError:
+ import unittest
def is_osx():
diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
index 0dbef1e..557c2d2 100644
--- a/tests/thumbnail_tests/test_templatetags.py
+++ b/tests/thumbnail_tests/test_templatetags.py
@@ -8,6 +8,7 @@ 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
@@ -167,6 +168,7 @@ 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
|