Ticket #7696: 7696-r7871.diff
File 7696-r7871.diff, 621 bytes (added by , 16 years ago) |
---|
-
tests/modeltests/model_forms/models.py
900 900 ... class Meta: 901 901 ... model = ImageFile 902 902 903 >>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png") ).read()903 >>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png"), 'rb').read() 904 904 905 905 >>> f = ImageFileForm(data={'description': u'An image'}, files={'image': SimpleUploadedFile('test.png', image_data)}) 906 906 >>> f.is_valid()