From 78edaeab6cca1c4483ae52128e7a3fba1fb8bda7 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Thu, 19 Dec 2019 16:32:13 +0100 Subject: [PATCH 1/2] Run collectstatic before the tests in CI This stops WhiteNoise from emitting warnings about STATIC_ROOT not existing. The alternative would be to set WHITENOISE_AUTOREFRESH = True in the settings. We currently don't have any settings that are only applied in CI and I think it makes sense to keep it that way to have the test environment as close to production as possible. See https://github.com/evansd/whitenoise/issues/191 Signed-off-by: Haiko Schol --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 34cec8358..f7b3dc116 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ before_script: - ./manage.py migrate script: + - ./manage.py collectstatic - pytest notifications: From c376e7523295b5594d30c8d212e157ed5a2d92a9 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Thu, 19 Dec 2019 16:47:24 +0100 Subject: [PATCH 2/2] Enable WhiteNoise autorefresh in "dev mode" This stops warnings about STATIC_ROOT missing. Signed-off-by: Haiko Schol --- vulnerablecode/dev.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vulnerablecode/dev.py b/vulnerablecode/dev.py index f957c4340..e874d69d1 100644 --- a/vulnerablecode/dev.py +++ b/vulnerablecode/dev.py @@ -5,3 +5,4 @@ ALLOWED_HOSTS = ['localhost', '127.0.0.1', '::1'] SECRET_KEY = 'hhismo6l@1uj)nr6@o7$b2u68w5*_o^liji+=uzq=954-f$8_1' +WHITENOISE_AUTOREFRESH = True