diff --git a/tests/middleware_exceptions/tests.py b/tests/middleware_exceptions/tests.py index bd8794ded3..3e614ae0de 100644 --- a/tests/middleware_exceptions/tests.py +++ b/tests/middleware_exceptions/tests.py @@ -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'):