def test_upload_to(self):
"""
Image upload_to should have a function which creates a path
"""
# pin the timestamps used in creating the URL
with patch('profiles.util.now_in_utc', autospec=True) as mocked_now_in_utc:
mocked_now_in_utc.return_value = now_in_utc()
with mute_signals(post_save):
profile = ProfileFactory.create()
assert profile.image.url.endswith(profile_image_upload_uri(None, "example.jpg").replace("+", ""))
assert profile.image_small.url.endswith(
profile_image_upload_uri_small(None, "example.jpg").replace("+", "")
)
assert profile.image_medium.url.endswith(
profile_image_upload_uri_medium(None, "example.jpg").replace("+", "")
)
评论列表
文章目录