Changes between Initial Version and Version 1 of Ticket #28148


Ignore:
Timestamp:
Apr 28, 2017, 8:11:19 AM (8 years ago)
Author:
rm_
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28148 – Description

    initial v1  
    11The following test code snippet stopped working on django 1.11 raising a validation error because the posted image has not a valid file extension:
    22
    3 ```
     3{{{
    44class Test(TestCase):
    55    def test_post(self):
     
    99        }
    1010        response = self.client.post(url, data=data)
    11 ```
     11}}}
    1212
    1313The view takes the data and fill the following ModelForm that fails validation:
    1414
    15 ```
     15{{{
    1616class Image(models.Model):
    1717    image = models.ImageField(_(u'Immagine'), upload_to='image')
     
    2121    class Meta:
    2222        model = Image
    23 ```
     23}}}
    2424
    2525As a workaround, adding a name attribute to the BytesIO object make the code work again:
    2626
    27 ```
     27{{{
    2828        img.name = 'ciao.jpg'
    29 ```
     29}}}
Back to Top