Changes between Initial Version and Version 1 of Ticket #28148
- Timestamp:
- Apr 28, 2017, 8:11:19 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28148 – Description
initial v1 1 1 The following test code snippet stopped working on django 1.11 raising a validation error because the posted image has not a valid file extension: 2 2 3 ``` 3 {{{ 4 4 class Test(TestCase): 5 5 def test_post(self): … … 9 9 } 10 10 response = self.client.post(url, data=data) 11 ``` 11 }}} 12 12 13 13 The view takes the data and fill the following ModelForm that fails validation: 14 14 15 ``` 15 {{{ 16 16 class Image(models.Model): 17 17 image = models.ImageField(_(u'Immagine'), upload_to='image') … … 21 21 class Meta: 22 22 model = Image 23 ``` 23 }}} 24 24 25 25 As a workaround, adding a name attribute to the BytesIO object make the code work again: 26 26 27 ``` 27 {{{ 28 28 img.name = 'ciao.jpg' 29 ``` 29 }}}