def test_exists(self): image = ImageModelFactory.create() thumbnail = Thumbnail(image.file.path, {'size': ['50', '50']}) assert thumbnail.exists() is False thumbnail.generate() assert thumbnail.exists() is True
def test_exists_dont_generate(self, generate_mock): image = ImageModelFactory.create() thumbnail = Thumbnail(image.file.path, {'size': ['50', '50']}) assert thumbnail.exists() is False assert generate_mock.called is False