Ticket #8196: 8196-r8757.diff
File 8196-r8757.diff, 2.3 KB (added by , 16 years ago) |
---|
-
tests/modeltests/model_forms/models.py
996 996 <class 'django.core.files.uploadedfile.SimpleUploadedFile'> 997 997 >>> instance = f.save() 998 998 >>> instance.image 999 < ImageFieldFile: tests/test.png>999 <...FieldFile: tests/test.png> 1000 1000 1001 1001 # Delete the current file since this is not done by Django. 1002 1002 >>> instance.image.delete() … … 1008 1008 <class 'django.core.files.uploadedfile.SimpleUploadedFile'> 1009 1009 >>> instance = f.save() 1010 1010 >>> instance.image 1011 < ImageFieldFile: tests/test.png>1011 <...FieldFile: tests/test.png> 1012 1012 1013 1013 # Edit an instance that already has the image defined in the model. This will not 1014 1014 # save the image again, but leave it exactly as it is. … … 1017 1017 >>> f.is_valid() 1018 1018 True 1019 1019 >>> f.cleaned_data['image'] 1020 < ImageFieldFile: tests/test.png>1020 <...FieldFile: tests/test.png> 1021 1021 >>> instance = f.save() 1022 1022 >>> instance.image 1023 < ImageFieldFile: tests/test.png>1023 <...FieldFile: tests/test.png> 1024 1024 1025 1025 # Delete the current image since this is not done by Django. 1026 1026 … … 1033 1033 True 1034 1034 >>> instance = f.save() 1035 1035 >>> instance.image 1036 < ImageFieldFile: tests/test2.png>1036 <...FieldFile: tests/test2.png> 1037 1037 1038 1038 # Delete the current file since this is not done by Django. 1039 1039 >>> instance.image.delete() … … 1044 1044 True 1045 1045 >>> instance = f.save() 1046 1046 >>> instance.image 1047 < ImageFieldFile: tests/test2.png>1047 <...FieldFile: tests/test2.png> 1048 1048 1049 1049 # Delete the current file since this is not done by Django. 1050 1050 >>> instance.image.delete() … … 1058 1058 True 1059 1059 >>> instance = f.save() 1060 1060 >>> instance.image 1061 < ImageFieldFile: None>1061 <...FieldFile: None> 1062 1062 1063 1063 >>> f = ImageFileForm(data={'description': u'And a final one'}, files={'image': SimpleUploadedFile('test3.png', image_data)}, instance=instance) 1064 1064 >>> f.is_valid() 1065 1065 True 1066 1066 >>> instance = f.save() 1067 1067 >>> instance.image 1068 < ImageFieldFile: tests/test3.png>1068 <...FieldFile: tests/test3.png> 1069 1069 1070 1070 # Delete the current file since this is not done by Django. 1071 1071 >>> instance.image.delete() … … 1076 1076 True 1077 1077 >>> instance = f.save() 1078 1078 >>> instance.image 1079 < ImageFieldFile: tests/test3.png>1079 <...FieldFile: tests/test3.png> 1080 1080 >>> instance.delete() 1081 1081 1082 1082 # Media on a ModelForm ########################################################