|
|
|
|
@ -2,7 +2,6 @@ import datetime
|
|
|
|
|
import logging |
|
|
|
|
import os |
|
|
|
|
from os.path import join |
|
|
|
|
from urllib.parse import quote |
|
|
|
|
|
|
|
|
|
import pytest |
|
|
|
|
|
|
|
|
|
@ -127,6 +126,25 @@ def test_media_iptc_override(settings):
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_media_img_format(settings): |
|
|
|
|
settings['img_format'] = 'jpeg' |
|
|
|
|
m = Image('11.tiff', 'dir1/test1', settings) |
|
|
|
|
path = join('dir1', 'test1') |
|
|
|
|
thumb = join('thumbnails', '11.tn.jpeg') |
|
|
|
|
|
|
|
|
|
assert m.dst_filename == '11.jpeg' |
|
|
|
|
assert m.src_path == join(settings['source'], path, '11.tiff') |
|
|
|
|
assert m.dst_path == join(settings['destination'], path, '11.jpeg') |
|
|
|
|
assert m.thumb_name == thumb |
|
|
|
|
assert m.thumb_path == join(settings['destination'], path, thumb) |
|
|
|
|
assert m.title == "Foo Bar" |
|
|
|
|
assert m.description == "<p>This is a funny description of this image</p>" |
|
|
|
|
|
|
|
|
|
file_path = join(path, '11.tiff') |
|
|
|
|
assert repr(m) == f"<Image>('{file_path}')" |
|
|
|
|
assert str(m) == file_path |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_image(settings, tmpdir): |
|
|
|
|
settings['destination'] = str(tmpdir) |
|
|
|
|
settings['datetime_format'] = '%d/%m/%Y' |
|
|
|
|
|