mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 00:26:33 +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_HOST_PASSWORD: ""
|
||||||
EMAIL_USE_TLS: true
|
EMAIL_USE_TLS: true
|
||||||
ENABLE_PREVIEW_IMAGES: false
|
ENABLE_PREVIEW_IMAGES: false
|
||||||
|
ENABLE_THUMBNAIL_GENERATION: true
|
||||||
run: |
|
run: |
|
||||||
pytest -n 3
|
pytest -n 3
|
||||||
|
|
|
@ -103,15 +103,16 @@ class Book(TestCase):
|
||||||
|
|
||||||
def test_thumbnail_fields(self):
|
def test_thumbnail_fields(self):
|
||||||
"""Just hit them"""
|
"""Just hit them"""
|
||||||
settings.ENABLE_THUMBNAIL_GENERATION = True
|
|
||||||
image_file = pathlib.Path(__file__).parent.joinpath(
|
image_file = pathlib.Path(__file__).parent.joinpath(
|
||||||
"../../static/images/default_avi.jpg"
|
"../../static/images/default_avi.jpg"
|
||||||
)
|
)
|
||||||
image = Image.open(image_file)
|
image = Image.open(image_file)
|
||||||
output = BytesIO()
|
output = BytesIO()
|
||||||
image.save(output, format=image.format)
|
image.save(output, format=image.format)
|
||||||
|
|
||||||
book = models.Edition.objects.create(title="hello")
|
book = models.Edition.objects.create(title="hello")
|
||||||
book.cover.save("test.jpg", ContentFile(output.getvalue()))
|
book.cover.save("test.jpg", ContentFile(output.getvalue()))
|
||||||
|
|
||||||
self.assertIsNotNone(book.cover_bw_book_xsmall_webp.url)
|
self.assertIsNotNone(book.cover_bw_book_xsmall_webp.url)
|
||||||
self.assertIsNotNone(book.cover_bw_book_xsmall_jpg.url)
|
self.assertIsNotNone(book.cover_bw_book_xsmall_jpg.url)
|
||||||
self.assertIsNotNone(book.cover_bw_book_small_webp.url)
|
self.assertIsNotNone(book.cover_bw_book_small_webp.url)
|
||||||
|
|
Loading…
Reference in a new issue