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
This commit is contained in:
Russell Keith-Magee 2011-06-13 13:23:49 +00:00
parent 13efd10465
commit c013c07ed7
1 changed files with 12 additions and 12 deletions

View File

@ -14,11 +14,19 @@ from django.utils.unittest import skipUnless
from modeltests.model_forms.models import (Article, ArticleStatus, from modeltests.model_forms.models import (Article, ArticleStatus,
BetterWriter, BigInt, Book, Category, CommaSeparatedInteger, BetterWriter, BigInt, Book, Category, CommaSeparatedInteger,
CustomFieldForExclusionModel, DerivedBook, DerivedPost, ExplicitPK, CustomFieldForExclusionModel, DerivedBook, DerivedPost, ExplicitPK,
FlexibleDatePost, ImageFile, ImprovedArticle, FlexibleDatePost, ImprovedArticle, ImprovedArticleWithParentLink,
ImprovedArticleWithParentLink, Inventory, OptionalImageFile, PhoneNumber, Inventory, PhoneNumber, Post, Price, Product, TextFile, Writer,
Post, Price, Product, TextFile, Writer, WriterProfile, WriterProfile, test_images)
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 ProductForm(forms.ModelForm):
class Meta: class Meta:
@ -149,14 +157,6 @@ class BigIntForm(forms.ModelForm):
class Meta: class Meta:
model = BigInt model = BigInt
class ImageFileForm(forms.ModelForm):
class Meta:
model = ImageFile
class OptionalImageFileForm(forms.ModelForm):
class Meta:
model = OptionalImageFile
class ModelFormWithMedia(forms.ModelForm): class ModelFormWithMedia(forms.ModelForm):
class Media: class Media:
js = ('/some/form/javascript',) js = ('/some/form/javascript',)