mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-22 16:16:39 +00:00
Settings
This commit is contained in:
parent
634ed50044
commit
1a082b5ee8
2 changed files with 3 additions and 1 deletions
1
.github/workflows/django-tests.yml
vendored
1
.github/workflows/django-tests.yml
vendored
|
@ -55,5 +55,6 @@ jobs:
|
|||
EMAIL_HOST_PASSWORD: ""
|
||||
EMAIL_USE_TLS: true
|
||||
ENABLE_PREVIEW_IMAGES: false
|
||||
ENABLE_THUMBNAIL_GENERATION: true
|
||||
run: |
|
||||
pytest -n 3
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue