diff options
| author | Claude Paroz <claude@2xlibre.net> | 2018-04-28 15:20:27 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-05-07 09:34:00 -0400 |
| commit | 607970f31cc07c317f2ebb684c8f3ccc36a95b3e (patch) | |
| tree | b11c0976fb161d3339025400b048a27ce5e2f19f /tests/view_tests | |
| parent | 7d3fe36c626a3268413eb86d37920f132eb4a54f (diff) | |
Replaced django.test.utils.patch_logger() with assertLogs().
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index e67d392d64..8aae115bb0 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -14,7 +14,7 @@ from django.db import DatabaseError, connection from django.shortcuts import render from django.template import TemplateDoesNotExist from django.test import RequestFactory, SimpleTestCase, override_settings -from django.test.utils import LoggingCaptureMixin, patch_logger +from django.test.utils import LoggingCaptureMixin from django.urls import reverse from django.utils.functional import SimpleLazyObject from django.utils.safestring import mark_safe @@ -253,9 +253,8 @@ class NonDjangoTemplatesDebugViewTests(SimpleTestCase): def test_400(self): # When DEBUG=True, technical_500_template() is called. - with patch_logger('django.security.SuspiciousOperation', 'error'): - response = self.client.get('/raises400/') - self.assertContains(response, '<div class="context" id="', status_code=400) + response = self.client.get('/raises400/') + self.assertContains(response, '<div class="context" id="', status_code=400) def test_403(self): response = self.client.get('/raises403/') |
