diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py index f2b0e05cc4f..e8598bd68f0 100644 --- a/tests/modeltests/model_forms/models.py +++ b/tests/modeltests/model_forms/models.py @@ -900,7 +900,7 @@ u'...test3.txt' ... class Meta: ... model = ImageFile ->>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png")).read() +>>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png"), 'rb').read() >>> f = ImageFileForm(data={'description': u'An image'}, files={'image': SimpleUploadedFile('test.png', image_data)}) >>> f.is_valid()