From 7b7305607c6a411ed0cf7c3a1507f03ba0ebe253 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 20 Jun 2020 15:48:54 +0200 Subject: [PATCH] root: enable debug logging when testing --- passbook/root/settings.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/passbook/root/settings.py b/passbook/root/settings.py index b36e411c0..9698ca73c 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -330,8 +330,19 @@ LOGGING = { }, "loggers": {}, } + +TEST = False +TEST_RUNNER = "xmlrunner.extra.djangotestrunner.XMLTestRunner" +TEST_OUTPUT_VERBOSE = 2 LOG_LEVEL = CONFIG.y("log_level").upper() +TEST_OUTPUT_FILE_NAME = "unittest.xml" + +if len(sys.argv) >= 2 and sys.argv[1] == "test": + LOG_LEVEL = "DEBUG" + TEST = True + CELERY_TASK_ALWAYS_EAGER = True + _LOGGING_HANDLER_MAP = { "": LOG_LEVEL, "passbook": LOG_LEVEL, @@ -350,16 +361,6 @@ for handler_name, level in _LOGGING_HANDLER_MAP.items(): "propagate": False, } -TEST = False -TEST_RUNNER = "xmlrunner.extra.djangotestrunner.XMLTestRunner" -TEST_OUTPUT_VERBOSE = 2 - -TEST_OUTPUT_FILE_NAME = "unittest.xml" - -if len(sys.argv) >= 2 and sys.argv[1] == "test": - TEST = True - CELERY_TASK_ALWAYS_EAGER = True - _DISALLOWED_ITEMS = [ "INSTALLED_APPS",