|
@@ 71-84 (lines=14) @@
|
| 68 |
|
after = os.path.getmtime(file_path) |
| 69 |
|
assert before == after |
| 70 |
|
|
| 71 |
|
def test_replace(self, image_upload_file): |
| 72 |
|
obj = ThumbnailModel.objects.create(image=image_upload_file) |
| 73 |
|
file_path = obj.image.thumbnail.path |
| 74 |
|
assert os.path.exists(file_path) |
| 75 |
|
before = os.path.getmtime(file_path) |
| 76 |
|
time.sleep(1) |
| 77 |
|
call_command( |
| 78 |
|
'rendervariations', |
| 79 |
|
'tests.ThumbnailModel.image', |
| 80 |
|
replace=True |
| 81 |
|
) |
| 82 |
|
assert os.path.exists(file_path) |
| 83 |
|
after = os.path.getmtime(file_path) |
| 84 |
|
assert before != after |
| 85 |
|
|
| 86 |
|
def test_ignore_missing(self, image_upload_file): |
| 87 |
|
obj = ThumbnailModel.objects.create(image=image_upload_file) |
|
@@ 57-69 (lines=13) @@
|
| 54 |
|
) |
| 55 |
|
assert any([os.path.exists(f) for f in file_names]) |
| 56 |
|
|
| 57 |
|
def test_no_replace(self, image_upload_file): |
| 58 |
|
obj = ThumbnailModel.objects.create(image=image_upload_file) |
| 59 |
|
file_path = obj.image.thumbnail.path |
| 60 |
|
assert os.path.exists(file_path) |
| 61 |
|
before = os.path.getmtime(file_path) |
| 62 |
|
time.sleep(1) |
| 63 |
|
call_command( |
| 64 |
|
'rendervariations', |
| 65 |
|
'tests.ThumbnailModel.image', |
| 66 |
|
) |
| 67 |
|
assert os.path.exists(file_path) |
| 68 |
|
after = os.path.getmtime(file_path) |
| 69 |
|
assert before == after |
| 70 |
|
|
| 71 |
|
def test_replace(self, image_upload_file): |
| 72 |
|
obj = ThumbnailModel.objects.create(image=image_upload_file) |