Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override DEBUG=True in async middleware compatibility tests #1977

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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