From 509f5a37b24416de5f460991651fd9da348aa51f Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 26 Mar 2014 13:56:40 +0000 Subject: [PATCH] Skip image backend tests for wand if wand is not installed --- wagtail/wagtailimages/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wagtail/wagtailimages/tests.py b/wagtail/wagtailimages/tests.py index 9c3bf0f28..b668cc608 100644 --- a/wagtail/wagtailimages/tests.py +++ b/wagtail/wagtailimages/tests.py @@ -4,6 +4,8 @@ from django.contrib.auth.models import User, Group, Permission from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile +import unittest + from wagtail.tests.utils import login from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.templatetags import image_tags @@ -118,6 +120,13 @@ class TestRenditions(TestCase): class TestRenditionsWand(TestCase): def setUp(self): + try: + import wand + except ImportError: + # skip these tests if Wand is not installed + raise unittest.SkipTest( + "Skipping image backend tests for wand, as wand is not installed") + # Create an image for running tests on self.image = Image.objects.create( title="Test image",