Ticket #8196: 8196-r8425.diff
File 8196-r8425.diff, 2.3 KB (added by , 16 years ago) |
---|
-
tests/modeltests/model_forms/models.py
915 915 <class 'django.core.files.uploadedfile.SimpleUploadedFile'> 916 916 >>> instance = f.save() 917 917 >>> instance.image 918 < ImageFieldFile: tests/test.png>918 <...FieldFile: tests/test.png> 919 919 920 920 # Delete the current file since this is not done by Django. 921 921 >>> instance.image.delete() … … 927 927 <class 'django.core.files.uploadedfile.SimpleUploadedFile'> 928 928 >>> instance = f.save() 929 929 >>> instance.image 930 < ImageFieldFile: tests/test.png>930 <...FieldFile: tests/test.png> 931 931 932 932 # Edit an instance that already has the image defined in the model. This will not 933 933 # save the image again, but leave it exactly as it is. … … 936 936 >>> f.is_valid() 937 937 True 938 938 >>> f.cleaned_data['image'] 939 < ImageFieldFile: tests/test.png>939 <...FieldFile: tests/test.png> 940 940 >>> instance = f.save() 941 941 >>> instance.image 942 < ImageFieldFile: tests/test.png>942 <...FieldFile: tests/test.png> 943 943 944 944 # Delete the current image since this is not done by Django. 945 945 … … 952 952 True 953 953 >>> instance = f.save() 954 954 >>> instance.image 955 < ImageFieldFile: tests/test2.png>955 <...FieldFile: tests/test2.png> 956 956 957 957 # Delete the current file since this is not done by Django. 958 958 >>> instance.image.delete() … … 963 963 True 964 964 >>> instance = f.save() 965 965 >>> instance.image 966 < ImageFieldFile: tests/test2.png>966 <...FieldFile: tests/test2.png> 967 967 968 968 # Delete the current file since this is not done by Django. 969 969 >>> instance.image.delete() … … 977 977 True 978 978 >>> instance = f.save() 979 979 >>> instance.image 980 < ImageFieldFile: None>980 <...FieldFile: None> 981 981 982 982 >>> f = ImageFileForm(data={'description': u'And a final one'}, files={'image': SimpleUploadedFile('test3.png', image_data)}, instance=instance) 983 983 >>> f.is_valid() 984 984 True 985 985 >>> instance = f.save() 986 986 >>> instance.image 987 < ImageFieldFile: tests/test3.png>987 <...FieldFile: tests/test3.png> 988 988 989 989 # Delete the current file since this is not done by Django. 990 990 >>> instance.image.delete() … … 995 995 True 996 996 >>> instance = f.save() 997 997 >>> instance.image 998 < ImageFieldFile: tests/test3.png>998 <...FieldFile: tests/test3.png> 999 999 >>> instance.delete() 1000 1000 1001 1001 # Media on a ModelForm ########################################################