From 7d8cdad6b704051bb69a47721913701349463ead Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 11 Mar 2020 12:25:00 +0100 Subject: [PATCH] Fixed MiddlewareNotUsedTests.test_do_not_log_when_debug_is_false(). This test didn't test anything without a middleware that raises an exception. --- tests/middleware_exceptions/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'):