mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed MiddlewareNotUsedTests.test_do_not_log_when_debug_is_false().
This test didn't test anything without a middleware that raises an exception.
This commit is contained in:
@@ -172,7 +172,10 @@ class MiddlewareNotUsedTests(SimpleTestCase):
|
|||||||
"MiddlewareNotUsed('middleware_exceptions.tests.MyMiddlewareWithExceptionMessage'): spam eggs"
|
"MiddlewareNotUsed('middleware_exceptions.tests.MyMiddlewareWithExceptionMessage'): spam eggs"
|
||||||
)
|
)
|
||||||
|
|
||||||
@override_settings(DEBUG=False)
|
@override_settings(
|
||||||
|
DEBUG=False,
|
||||||
|
MIDDLEWARE=['middleware_exceptions.tests.MyMiddleware'],
|
||||||
|
)
|
||||||
def test_do_not_log_when_debug_is_false(self):
|
def test_do_not_log_when_debug_is_false(self):
|
||||||
with self.assertRaisesMessage(AssertionError, 'no logs'):
|
with self.assertRaisesMessage(AssertionError, 'no logs'):
|
||||||
with self.assertLogs('django.request', 'DEBUG'):
|
with self.assertLogs('django.request', 'DEBUG'):
|
||||||
|
|||||||
Reference in New Issue
Block a user