Code

Ticket #7696: 7696-r7871.diff

File 7696-r7871.diff, 621 bytes (added by Gulopine, 6 years ago)

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

Line 
1Index: tests/modeltests/model_forms/models.py
2===================================================================
3--- tests/modeltests/model_forms/models.py      (revision 7859)
4+++ tests/modeltests/model_forms/models.py      (working copy)
5@@ -900,7 +900,7 @@
6 ...     class Meta:
7 ...         model = ImageFile
8 
9->>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png")).read()
10+>>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png"), 'rb').read()
11 
12 >>> f = ImageFileForm(data={'description': u'An image'}, files={'image': SimpleUploadedFile('test.png', image_data)})
13 >>> f.is_valid()