Code

Ticket #16645: 16645.patch

File 16645.patch, 1.4 KB (added by aaugustin, 3 years ago)
  • tests/modeltests/model_forms/tests.py

     
    13171317        f = OptionalImageFileForm(data={'description': u'Test'}) 
    13181318        self.assertEqual(f.is_valid(), True) 
    13191319        instance = f.save() 
    1320         self.assertEqual(instance.image.name, None) 
     1320        self.assertEqual(instance.image.name, '') 
    13211321        self.assertEqual(instance.width, None) 
    13221322        self.assertEqual(instance.height, None) 
    13231323 
  • tests/modeltests/model_forms/models.py

     
    132132        description = models.CharField(max_length=20) 
    133133        image = models.ImageField(storage=temp_storage, upload_to=custom_upload_path, 
    134134                                  width_field='width', height_field='height', 
    135                                   blank=True, null=True) 
     135                                  blank=True) 
    136136        width = models.IntegerField(editable=False, null=True) 
    137137        height = models.IntegerField(editable=False, null=True) 
    138138        path = models.CharField(max_length=16, blank=True, default='')