Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@freakboy3742 freakboy3742 authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 tests/modeltests/model_forms/tests.py
View
24 tests/modeltests/model_forms/tests.py
@@ -14,11 +14,19 @@
from modeltests.model_forms.models import (Article, ArticleStatus,
BetterWriter, BigInt, Book, Category, CommaSeparatedInteger,
CustomFieldForExclusionModel, DerivedBook, DerivedPost, ExplicitPK,
- FlexibleDatePost, ImageFile, ImprovedArticle,
- ImprovedArticleWithParentLink, Inventory, OptionalImageFile, PhoneNumber,
- Post, Price, Product, TextFile, Writer, WriterProfile,
- test_images)
+ FlexibleDatePost, ImprovedArticle, ImprovedArticleWithParentLink,
+ Inventory, PhoneNumber, Post, Price, Product, TextFile, Writer,
+ WriterProfile, test_images)
+if test_images:
+ from modeltests.model_forms.models import ImageFile, OptionalImageFile
+ class ImageFileForm(forms.ModelForm):
+ class Meta:
+ model = ImageFile
+
+ class OptionalImageFileForm(forms.ModelForm):
+ class Meta:
+ model = OptionalImageFile
class ProductForm(forms.ModelForm):
class Meta:
@@ -149,14 +157,6 @@ class BigIntForm(forms.ModelForm):
class Meta:
model = BigInt
-class ImageFileForm(forms.ModelForm):
- class Meta:
- model = ImageFile
-
-class OptionalImageFileForm(forms.ModelForm):
- class Meta:
- model = OptionalImageFile
-
class ModelFormWithMedia(forms.ModelForm):
class Media:
js = ('/some/form/javascript',)
Please sign in to comment.
Something went wrong with that request. Please try again.