📜  django test imagefield - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:40.704000             🧑  作者: Mango

代码示例1
from django.core.files.uploadedfile import SimpleUploadedFile

newPhoto.image = SimpleUploadedFile(name='test_image.jpg', content=open(image_path, 'rb').read(), content_type='image/jpeg')