Skip to content

Commit

Permalink
toggle debug to true so that debug middleware make a complete run
Browse files Browse the repository at this point in the history
  • Loading branch information
salty-ivy authored and tim-schilling committed Aug 2, 2024
1 parent c5cdd70 commit 573a87b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_middleware_compatibility.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 573a87b

Please sign in to comment.