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:
Mariusz Felisiak 2020-03-11 12:25:00 +01:00
parent 35c7fe8334
commit 7d8cdad6b7
1 changed files with 4 additions and 1 deletions

View File

@ -172,7 +172,10 @@ class MiddlewareNotUsedTests(SimpleTestCase):
"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):
with self.assertRaisesMessage(AssertionError, 'no logs'):
with self.assertLogs('django.request', 'DEBUG'):