How do I make FactoryBoy ImageField generate an image before calling save ()?
Subj.
Right now (Factory Boy version 2.4.1.) With this code:
class ImageFactory(factory.django.DjangoModelFactory):
class Meta:
model = Image
image = factory.django.ImageField(width=1024, height=768)
image
will be None
at the time of saving, so if the model image
has been save
overridden and its function works with image
, it will not work. And this is definitely my business.
So - how to make the image generated before the call save
?
+3
source to share