root: enable debug logging when testing

This commit is contained in:
Jens Langhammer 2020-06-20 15:48:54 +02:00
parent f1e6d91289
commit 7b7305607c
1 changed files with 11 additions and 10 deletions

View File

@ -330,8 +330,19 @@ LOGGING = {
}, },
"loggers": {}, "loggers": {},
} }
TEST = False
TEST_RUNNER = "xmlrunner.extra.djangotestrunner.XMLTestRunner"
TEST_OUTPUT_VERBOSE = 2
LOG_LEVEL = CONFIG.y("log_level").upper() 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 = { _LOGGING_HANDLER_MAP = {
"": LOG_LEVEL, "": LOG_LEVEL,
"passbook": LOG_LEVEL, "passbook": LOG_LEVEL,
@ -350,16 +361,6 @@ for handler_name, level in _LOGGING_HANDLER_MAP.items():
"propagate": False, "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 = [ _DISALLOWED_ITEMS = [
"INSTALLED_APPS", "INSTALLED_APPS",