Ticket #16243: 16243.model_forms-pil-tests.diff

File 16243.model_forms-pil-tests.diff, 1.6 KB (added by julien, 4 years ago)
  • tests/modeltests/model_forms/tests.py

    diff --git a/tests/modeltests/model_forms/tests.py b/tests/modeltests/model_forms/tests.py
    index b67c160..0831035 100644
    a b from django.utils.unittest import skipUnless 
    1414from modeltests.model_forms.models import (Article, ArticleStatus,
    1515    BetterWriter, BigInt, Book, Category, CommaSeparatedInteger,
    1616    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)
    2120
     21if 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
    2230
    2331class ProductForm(forms.ModelForm):
    2432    class Meta:
    class BigIntForm(forms.ModelForm): 
    149157    class Meta:
    150158        model = BigInt
    151159
    152 class ImageFileForm(forms.ModelForm):
    153     class Meta:
    154         model = ImageFile
    155 
    156 class OptionalImageFileForm(forms.ModelForm):
    157     class Meta:
    158         model = OptionalImageFile
    159 
    160160class ModelFormWithMedia(forms.ModelForm):
    161161    class Media:
    162162        js = ('/some/form/javascript',)
Back to Top