summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_fields/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/model_fields/tests.py')
-rw-r--r--tests/regressiontests/model_fields/tests.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py
index 0815d9ef3c..7a6fee5a2a 100644
--- a/tests/regressiontests/model_fields/tests.py
+++ b/tests/regressiontests/model_fields/tests.py
@@ -6,13 +6,26 @@ from django import forms
from django.db import models
from django.core.exceptions import ValidationError
-from models import Foo, Bar, Whiz, BigD, BigS
+from models import Foo, Bar, Whiz, BigD, BigS, Image
try:
from decimal import Decimal
except ImportError:
from django.utils._decimal import Decimal
+
+# If PIL available, do these tests.
+if Image:
+ from imagefield import \
+ ImageFieldTests, \
+ ImageFieldTwoDimensionsTests, \
+ ImageFieldNoDimensionsTests, \
+ ImageFieldOneDimensionTests, \
+ ImageFieldDimensionsFirstTests, \
+ ImageFieldUsingFileTests, \
+ TwoImageFieldTests
+
+
class DecimalFieldTests(django.test.TestCase):
def test_to_python(self):
f = models.DecimalField(max_digits=4, decimal_places=2)
@@ -131,4 +144,3 @@ class SlugFieldTests(django.test.TestCase):
bs = BigS.objects.create(s = 'slug'*50)
bs = BigS.objects.get(pk=bs.pk)
self.assertEqual(bs.s, 'slug'*50)
-