mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
Merge pull request #2547 from avandeursen/docker-test-run
Ensure django tests pass in default Docker setting
This commit is contained in:
commit
c9fa90f83b
3 changed files with 9 additions and 2 deletions
|
@ -61,7 +61,7 @@ SEARCH_TIMEOUT=5
|
||||||
QUERY_TIMEOUT=5
|
QUERY_TIMEOUT=5
|
||||||
|
|
||||||
# Thumbnails Generation
|
# Thumbnails Generation
|
||||||
ENABLE_THUMBNAIL_GENERATION=false
|
ENABLE_THUMBNAIL_GENERATION=true
|
||||||
|
|
||||||
# S3 configuration
|
# S3 configuration
|
||||||
USE_S3=false
|
USE_S3=false
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
|
@ -10,6 +12,7 @@ from django.utils import timezone
|
||||||
|
|
||||||
from bookwyrm import models, settings
|
from bookwyrm import models, settings
|
||||||
from bookwyrm.models.book import isbn_10_to_13, isbn_13_to_10
|
from bookwyrm.models.book import isbn_10_to_13, isbn_13_to_10
|
||||||
|
from bookwyrm.settings import ENABLE_THUMBNAIL_GENERATION
|
||||||
|
|
||||||
|
|
||||||
class Book(TestCase):
|
class Book(TestCase):
|
||||||
|
@ -101,6 +104,10 @@ class Book(TestCase):
|
||||||
self.first_edition.save()
|
self.first_edition.save()
|
||||||
self.assertEqual(self.first_edition.edition_rank, 1)
|
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):
|
def test_thumbnail_fields(self):
|
||||||
"""Just hit them"""
|
"""Just hit them"""
|
||||||
image_file = pathlib.Path(__file__).parent.joinpath(
|
image_file = pathlib.Path(__file__).parent.joinpath(
|
||||||
|
|
|
@ -15,7 +15,7 @@ services:
|
||||||
- static_volume:/app/static
|
- static_volume:/app/static
|
||||||
- media_volume:/app/images
|
- media_volume:/app/images
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:13
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
|
Loading…
Reference in a new issue