Fixed #24526 -- Combined django.request/security loggers with the root logger.

Thanks Carl Meyer for review.
This commit is contained in:
Tim Graham 2015-03-23 18:17:43 -04:00
parent 37682368a6
commit 8efea1b8d5
8 changed files with 75 additions and 49 deletions

View file

@ -19,6 +19,7 @@ from django.utils._os import upath
from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedInDjango21Warning,
)
from django.utils.log import DEFAULT_LOGGING
warnings.simplefilter("error", RemovedInDjango20Warning)
warnings.simplefilter("error", RemovedInDjango21Warning)
@ -144,6 +145,11 @@ def setup(verbosity, test_labels):
'auth': 'django.contrib.auth.tests.migrations',
'contenttypes': 'contenttypes_tests.migrations',
}
log_config = DEFAULT_LOGGING
# Filter out non-error logging so we don't have to capture it in lots of
# tests.
log_config['loggers']['django']['level'] = 'ERROR'
settings.LOGGING = log_config
if verbosity > 0:
# Ensure any warnings captured to logging are piped through a verbose