From 8efea1b8d5b5fb0cfef1a3244c339cebf8af36c5 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 23 Mar 2015 18:17:43 -0400 Subject: Fixed #24526 -- Combined django.request/security loggers with the root logger. Thanks Carl Meyer for review. --- tests/view_tests/tests/test_debug.py | 7 ++++--- tests/view_tests/views.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/view_tests') diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index 9dca0fb339..ca852f0f0d 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -16,6 +16,7 @@ from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.template.base import TemplateDoesNotExist from django.test import RequestFactory, TestCase, override_settings +from django.test.utils import LoggingCaptureMixin from django.utils import six from django.utils.encoding import force_bytes, force_text from django.utils.functional import SimpleLazyObject @@ -48,7 +49,7 @@ class CallableSettingWrapperTests(TestCase): @override_settings(DEBUG=True, ROOT_URLCONF="view_tests.urls") -class DebugViewTests(TestCase): +class DebugViewTests(LoggingCaptureMixin, TestCase): def test_files(self): response = self.client.get('/raises/') @@ -642,7 +643,7 @@ class ExceptionReportTestMixin(object): @override_settings(ROOT_URLCONF='view_tests.urls') -class ExceptionReporterFilterTests(TestCase, ExceptionReportTestMixin): +class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin, TestCase): """ Ensure that sensitive information can be filtered out of error reports. Refs #14614. @@ -833,7 +834,7 @@ class ExceptionReporterFilterTests(TestCase, ExceptionReportTestMixin): self.assertNotContains(response, 'should not be displayed', status_code=500) -class AjaxResponseExceptionReporterFilter(TestCase, ExceptionReportTestMixin): +class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptureMixin, TestCase): """ Ensure that sensitive information can be filtered out of error reports. diff --git a/tests/view_tests/views.py b/tests/view_tests/views.py index c5ea86c101..c4d025c349 100644 --- a/tests/view_tests/views.py +++ b/tests/view_tests/views.py @@ -102,7 +102,7 @@ def render_no_template(request): def send_log(request, exc_info): - logger = logging.getLogger('django.request') + logger = logging.getLogger('django') # The default logging config has a logging filter to ensure admin emails are # only sent with DEBUG=False, but since someone might choose to remove that # filter, we still want to be able to test the behavior of error emails -- cgit v1.3