Skip to content

Commit

Permalink
Refs #33735 -- Captured stderr during ASGITest.test_file_response.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls authored and sarahboyce committed Nov 27, 2024
1 parent c635dec commit a5bc0cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/asgi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
modify_settings,
override_settings,
)
from django.test.utils import captured_stderr
from django.urls import path
from django.utils.http import http_date
from django.views.decorators.csrf import csrf_exempt
Expand Down Expand Up @@ -95,7 +96,8 @@ async def test_file_response(self):
with open(test_filename, "rb") as test_file:
test_file_contents = test_file.read()
# Read the response.
response_start = await communicator.receive_output()
with captured_stderr():
response_start = await communicator.receive_output()
self.assertEqual(response_start["type"], "http.response.start")
self.assertEqual(response_start["status"], 200)
headers = response_start["headers"]
Expand Down

0 comments on commit a5bc0cf

Please sign in to comment.