diff --git a/tests/test_middleware_compatibility.py b/tests/test_middleware_compatibility.py index d3025c1ea..99ed7db82 100644 --- a/tests/test_middleware_compatibility.py +++ b/tests/test_middleware_compatibility.py @@ -1,7 +1,7 @@ import asyncio from django.http import HttpResponse -from django.test import AsyncRequestFactory, RequestFactory, TestCase +from django.test import AsyncRequestFactory, RequestFactory, TestCase, override_settings from debug_toolbar.middleware import DebugToolbarMiddleware @@ -11,6 +11,7 @@ def setUp(self): self.factory = RequestFactory() self.async_factory = AsyncRequestFactory() + @override_settings(DEBUG=True) def test_sync_mode(self): """ test middlware switches to sync (__call__) based on get_response type @@ -26,6 +27,7 @@ def test_sync_mode(self): response = middleware(request) self.assertEqual(response.status_code, 200) + @override_settings(DEBUG=True) async def test_async_mode(self): """ test middlware switches to async (__acall__) based on get_response type