Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16243 -- Corrected test suite failure in model_forms when PIL …

…isn't installed

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c013c07ed7908b009cfd2ccc511e3e635c66f3d6 1 parent 13efd10
Russell Keith-Magee authored

Showing 1 changed file with 12 additions and 12 deletions. Show diff stats Hide diff stats

  1. 24  tests/modeltests/model_forms/tests.py
24  tests/modeltests/model_forms/tests.py
@@ -14,11 +14,19 @@
14 14
 from modeltests.model_forms.models import (Article, ArticleStatus,
15 15
     BetterWriter, BigInt, Book, Category, CommaSeparatedInteger,
16 16
     CustomFieldForExclusionModel, DerivedBook, DerivedPost, ExplicitPK,
17  
-    FlexibleDatePost, ImageFile, ImprovedArticle,
18  
-    ImprovedArticleWithParentLink, Inventory, OptionalImageFile, PhoneNumber,
19  
-    Post, Price, Product, TextFile, Writer, WriterProfile,
20  
-    test_images)
  17
+    FlexibleDatePost, ImprovedArticle, ImprovedArticleWithParentLink,
  18
+    Inventory, PhoneNumber, Post, Price, Product, TextFile, Writer,
  19
+    WriterProfile, test_images)
21 20
 
  21
+if test_images:
  22
+    from modeltests.model_forms.models import ImageFile, OptionalImageFile
  23
+    class ImageFileForm(forms.ModelForm):
  24
+        class Meta:
  25
+            model = ImageFile
  26
+
  27
+    class OptionalImageFileForm(forms.ModelForm):
  28
+        class Meta:
  29
+            model = OptionalImageFile
22 30
 
23 31
 class ProductForm(forms.ModelForm):
24 32
     class Meta:
@@ -149,14 +157,6 @@ class BigIntForm(forms.ModelForm):
149 157
     class Meta:
150 158
         model = BigInt
151 159
 
152  
-class ImageFileForm(forms.ModelForm):
153  
-    class Meta:
154  
-        model = ImageFile
155  
-
156  
-class OptionalImageFileForm(forms.ModelForm):
157  
-    class Meta:
158  
-        model = OptionalImageFile
159  
-
160 160
 class ModelFormWithMedia(forms.ModelForm):
161 161
     class Media:
162 162
         js = ('/some/form/javascript',)

0 notes on commit c013c07

Please sign in to comment.
Something went wrong with that request. Please try again.