diff options
| author | Tim Graham <timograham@gmail.com> | 2015-03-23 18:17:43 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-24 11:07:42 -0400 |
| commit | 8efea1b8d5b5fb0cfef1a3244c339cebf8af36c5 (patch) | |
| tree | 31d7ef33be2de88e47d2f6a1e698d210dd09baa2 /tests/view_tests | |
| parent | 37682368a604e08f3135375c85529e566492a352 (diff) | |
Fixed #24526 -- Combined django.request/security loggers with the root logger.
Thanks Carl Meyer for review.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 7 | ||||
| -rw-r--r-- | tests/view_tests/views.py | 2 |
2 files changed, 5 insertions, 4 deletions
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 |
