Ticket #7696: 7696-r7871.diff

File 7696-r7871.diff, 621 bytes (added by Marty Alchin, 16 years ago)

Adds an explicit , 'rb' to open() to fix this on Windows

  • tests/modeltests/model_forms/models.py

     
    900900...     class Meta:
    901901...         model = ImageFile
    902902
    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()
    904904
    905905>>> f = ImageFileForm(data={'description': u'An image'}, files={'image': SimpleUploadedFile('test.png', image_data)})
    906906>>> f.is_valid()
Back to Top