diff --git a/.env.example b/.env.example index 4c457f625..dd7bec4f2 100644 --- a/.env.example +++ b/.env.example @@ -61,7 +61,7 @@ SEARCH_TIMEOUT=5 QUERY_TIMEOUT=5 # Thumbnails Generation -ENABLE_THUMBNAIL_GENERATION=false +ENABLE_THUMBNAIL_GENERATION=true # S3 configuration USE_S3=false diff --git a/bookwyrm/tests/models/test_book_model.py b/bookwyrm/tests/models/test_book_model.py index 5a2a6c3b6..33854b3d6 100644 --- a/bookwyrm/tests/models/test_book_model.py +++ b/bookwyrm/tests/models/test_book_model.py @@ -2,6 +2,8 @@ from io import BytesIO import pathlib +import pytest + from dateutil.parser import parse from PIL import Image from django.core.files.base import ContentFile @@ -10,6 +12,7 @@ from django.utils import timezone from bookwyrm import models, settings from bookwyrm.models.book import isbn_10_to_13, isbn_13_to_10 +from bookwyrm.settings import ENABLE_THUMBNAIL_GENERATION class Book(TestCase): @@ -101,6 +104,10 @@ class Book(TestCase): self.first_edition.save() self.assertEqual(self.first_edition.edition_rank, 1) + @pytest.mark.skipif( + not ENABLE_THUMBNAIL_GENERATION, + reason="Thumbnail generation disabled in settings", + ) def test_thumbnail_fields(self): """Just hit them""" image_file = pathlib.Path(__file__).parent.joinpath( diff --git a/docker-compose.yml b/docker-compose.yml index e98128544..4ab7a1c34 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - static_volume:/app/static - media_volume:/app/images db: - image: postgres + image: postgres:13 env_file: .env volumes: - pgdata:/var/lib/postgresql/data