This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from freezegun import freeze_time | |
import pytest | |
def my_func(date=datetime.date.today()): | |
is_monday = date.weekday() == 0 | |
return date, is_monday |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
picture = product.picture | |
picture = UploadedFile( | |
picture.file, name=path.split(picture.name)[1], size=picture.size, content_type='image/png') | |
image = Image.objects.create(file=picture, folder=folder) | |
product.image = image | |
product.save(update_fields=['image']) |