Ticket #8196: 8196-r8757.diff

File 8196-r8757.diff, 2.3 KB (added by Richard Davies <richard.davies@…>, 16 years ago)

Updated patch so it still applies cleanly to r8757

  • tests/modeltests/model_forms/models.py

     
    996996<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
    997997>>> instance = f.save()
    998998>>> instance.image
    999 <ImageFieldFile: tests/test.png>
     999<...FieldFile: tests/test.png>
    10001000
    10011001# Delete the current file since this is not done by Django.
    10021002>>> instance.image.delete()
     
    10081008<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
    10091009>>> instance = f.save()
    10101010>>> instance.image
    1011 <ImageFieldFile: tests/test.png>
     1011<...FieldFile: tests/test.png>
    10121012
    10131013# Edit an instance that already has the image defined in the model. This will not
    10141014# save the image again, but leave it exactly as it is.
     
    10171017>>> f.is_valid()
    10181018True
    10191019>>> f.cleaned_data['image']
    1020 <ImageFieldFile: tests/test.png>
     1020<...FieldFile: tests/test.png>
    10211021>>> instance = f.save()
    10221022>>> instance.image
    1023 <ImageFieldFile: tests/test.png>
     1023<...FieldFile: tests/test.png>
    10241024
    10251025# Delete the current image since this is not done by Django.
    10261026
     
    10331033True
    10341034>>> instance = f.save()
    10351035>>> instance.image
    1036 <ImageFieldFile: tests/test2.png>
     1036<...FieldFile: tests/test2.png>
    10371037
    10381038# Delete the current file since this is not done by Django.
    10391039>>> instance.image.delete()
     
    10441044True
    10451045>>> instance = f.save()
    10461046>>> instance.image
    1047 <ImageFieldFile: tests/test2.png>
     1047<...FieldFile: tests/test2.png>
    10481048
    10491049# Delete the current file since this is not done by Django.
    10501050>>> instance.image.delete()
     
    10581058True
    10591059>>> instance = f.save()
    10601060>>> instance.image
    1061 <ImageFieldFile: None>
     1061<...FieldFile: None>
    10621062
    10631063>>> f = ImageFileForm(data={'description': u'And a final one'}, files={'image': SimpleUploadedFile('test3.png', image_data)}, instance=instance)
    10641064>>> f.is_valid()
    10651065True
    10661066>>> instance = f.save()
    10671067>>> instance.image
    1068 <ImageFieldFile: tests/test3.png>
     1068<...FieldFile: tests/test3.png>
    10691069
    10701070# Delete the current file since this is not done by Django.
    10711071>>> instance.image.delete()
     
    10761076True
    10771077>>> instance = f.save()
    10781078>>> instance.image
    1079 <ImageFieldFile: tests/test3.png>
     1079<...FieldFile: tests/test3.png>
    10801080>>> instance.delete()
    10811081
    10821082# Media on a ModelForm ########################################################
Back to Top