From 1a082b5ee88790e3b815dda12dd48db839b12d59 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 7 Jul 2022 11:37:34 -0700 Subject: [PATCH] Settings --- .github/workflows/django-tests.yml | 1 + bookwyrm/tests/models/test_book_model.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/django-tests.yml b/.github/workflows/django-tests.yml index 00e08dadb..97a744813 100644 --- a/.github/workflows/django-tests.yml +++ b/.github/workflows/django-tests.yml @@ -55,5 +55,6 @@ jobs: EMAIL_HOST_PASSWORD: "" EMAIL_USE_TLS: true ENABLE_PREVIEW_IMAGES: false + ENABLE_THUMBNAIL_GENERATION: true run: | pytest -n 3 diff --git a/bookwyrm/tests/models/test_book_model.py b/bookwyrm/tests/models/test_book_model.py index a5ddc2504..5a2a6c3b6 100644 --- a/bookwyrm/tests/models/test_book_model.py +++ b/bookwyrm/tests/models/test_book_model.py @@ -103,15 +103,16 @@ class Book(TestCase): def test_thumbnail_fields(self): """Just hit them""" - settings.ENABLE_THUMBNAIL_GENERATION = True image_file = pathlib.Path(__file__).parent.joinpath( "../../static/images/default_avi.jpg" ) image = Image.open(image_file) output = BytesIO() image.save(output, format=image.format) + book = models.Edition.objects.create(title="hello") book.cover.save("test.jpg", ContentFile(output.getvalue())) + self.assertIsNotNone(book.cover_bw_book_xsmall_webp.url) self.assertIsNotNone(book.cover_bw_book_xsmall_jpg.url) self.assertIsNotNone(book.cover_bw_book_small_webp.url)