From 573a87baa9e72b66ae90834b316efea10f76c0fb Mon Sep 17 00:00:00 2001 From: Aman Pandey Date: Fri, 2 Aug 2024 18:58:13 +0530 Subject: [PATCH] toggle debug to true so that debug middleware make a complete run --- tests/test_middleware_compatibility.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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