diff --git a/api/compose/django/dev-entrypoint.sh b/api/compose/django/dev-entrypoint.sh new file mode 100755 index 0000000000000000000000000000000000000000..416207b43d66d6ec7d05b12dd508c33577b8afda --- /dev/null +++ b/api/compose/django/dev-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +if [ $1 = "pytest" ]; then + # let pytest.ini handle it + unset DJANGO_SETTINGS_MODULE +fi +exec "$@" diff --git a/api/config/settings/test.py b/api/config/settings/test.py index a0b6b2503a1762295c960cae50c06c65c50a4d76..aff29c6571252d1f0d401c550cedf09998a5c512 100644 --- a/api/config/settings/test.py +++ b/api/config/settings/test.py @@ -19,10 +19,6 @@ CACHES = { CELERY_BROKER_URL = 'memory://' -# TESTING -# ------------------------------------------------------------------------------ -TEST_RUNNER = 'django.test.runner.DiscoverRunner' - ########## CELERY # In development, all tasks will be executed locally by blocking until the task returns CELERY_TASK_ALWAYS_EAGER = True @@ -30,3 +26,4 @@ CELERY_TASK_ALWAYS_EAGER = True # Your local stuff: Below this line define 3rd party library settings API_AUTHENTICATION_REQUIRED = False +CACHEOPS_ENABLED = False diff --git a/api/docker/Dockerfile.test b/api/docker/Dockerfile.test index 00638e9dd3cb5d290d336698a842f826d73583e9..0990efa512e6a1084249e331e4146f8a223332f5 100644 --- a/api/docker/Dockerfile.test +++ b/api/docker/Dockerfile.test @@ -23,3 +23,4 @@ RUN pip install -r /requirements/test.txt COPY . /app WORKDIR /app +ENTRYPOINT ["compose/django/dev-entrypoint.sh"] diff --git a/api/test.yml b/api/test.yml deleted file mode 100644 index 85a3a37f0ed015006cc290aa7edd44dfd95df9a0..0000000000000000000000000000000000000000 --- a/api/test.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '2' -services: - test: - build: - dockerfile: docker/Dockerfile.test - context: . - command: pytest - depends_on: - - postgres - volumes: - - .:/app - environment: - - "DJANGO_ALLOWED_HOSTS=localhost" - - "DATABASE_URL=postgresql://postgres@postgres/postgres" - - "FUNKWHALE_URL=https://funkwhale.test" - - "CACHEOPS_ENABLED=False" - postgres: - image: postgres