Answers for "django test imagefield"

0

django test imagefield

from django.core.files.uploadedfile import SimpleUploadedFile

newPhoto.image = SimpleUploadedFile(name='test_image.jpg', content=open(image_path, 'rb').read(), content_type='image/jpeg')
Posted by: Guest on October-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language