Browse Source

Use DEBUG=False for testing collectstatic in CI

Sage Abdullah 1 year ago
parent
commit
f372cf1ba4
3 changed files with 3 additions and 2 deletions
  1. 2 0
      .circleci/config.yml
  2. 1 1
      wagtail/test/settings.py
  3. 0 1
      wagtail/test/settings_ui.py

+ 2 - 0
.circleci/config.yml

@@ -66,6 +66,7 @@ jobs:
     environment:
       PIPENV_VENV_IN_PROJECT: true
       DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
+      DJANGO_DEBUG: true
     steps:
       - checkout
       - attach_workspace:
@@ -110,6 +111,7 @@ jobs:
       - run:
           command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
           environment:
+            DJANGO_DEBUG: false
             STATICFILES_STORAGE: manifest
       - store_test_results:
           path: ./reports/jest

+ 1 - 1
wagtail/test/settings.py

@@ -3,7 +3,7 @@ import os
 from django.contrib.messages import constants as message_constants
 from django.utils.translation import gettext_lazy as _
 
-DEBUG = False
+DEBUG = os.environ.get("DJANGO_DEBUG", "false").lower() == "true"
 WAGTAIL_ROOT = os.path.dirname(os.path.dirname(__file__))
 WAGTAILADMIN_BASE_URL = "http://testserver"
 STATIC_ROOT = os.path.join(WAGTAIL_ROOT, "tests", "test-static")

+ 0 - 1
wagtail/test/settings_ui.py

@@ -1,7 +1,6 @@
 from .settings import *  # noqa: F403
 
 # Settings meant to run the test suite with Django’s development server, for integration tests.
-DEBUG = True
 
 DATABASES["default"]["NAME"] = "ui_tests.db"  # noqa: F405