mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-11 06:25:10 +00:00
Entirely removes the optipng, updates ghostscript fall back to also use WebP. Updates the conversion to use a multiprocessing pool
This commit is contained in:
@@ -137,32 +137,3 @@ class TestConvertThumbnails(TestCase):
|
||||
run_convert_mock.assert_called_once()
|
||||
self.assertIn("Error converting thumbnail", stderr)
|
||||
self.assertTrue(thumb_file.exists())
|
||||
|
||||
@mock.patch("documents.management.commands.convert_thumbnails.run_convert")
|
||||
def test_convert_single_thumbnail_no_output(self, run_convert_mock):
|
||||
"""
|
||||
GIVEN:
|
||||
- Document exists with PNG thumbnail
|
||||
WHEN:
|
||||
- Thumbnail conversion is attempted, but there is no output WebP
|
||||
THEN:
|
||||
- Single thumbnail is converted
|
||||
"""
|
||||
|
||||
with tempfile.TemporaryDirectory() as thumbnail_dir:
|
||||
|
||||
with override_settings(
|
||||
THUMBNAIL_DIR=thumbnail_dir,
|
||||
):
|
||||
|
||||
thumb_file = self.create_png_thumbnail_file(thumbnail_dir)
|
||||
|
||||
stdout, stderr = self.call_command()
|
||||
|
||||
run_convert_mock.assert_called_once()
|
||||
self.assertIn(f"{thumb_file}", stdout)
|
||||
self.assertNotIn("Conversion to WebP completed", stdout)
|
||||
self.assertIn("Converted thumbnail doesn't exist", stderr)
|
||||
|
||||
self.assertTrue(thumb_file.exists())
|
||||
self.assertFalse(thumb_file.with_suffix(".webp").exists())
|
||||
|
||||
Reference in New Issue
Block a user