mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Refs #33735 -- Captured stderr during ASGITest.test_file_response.
This commit is contained in:
parent
c635decb00
commit
a5bc0cfd35
@ -21,6 +21,7 @@ from django.test import (
|
|||||||
modify_settings,
|
modify_settings,
|
||||||
override_settings,
|
override_settings,
|
||||||
)
|
)
|
||||||
|
from django.test.utils import captured_stderr
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from django.utils.http import http_date
|
from django.utils.http import http_date
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
@ -95,7 +96,8 @@ class ASGITest(SimpleTestCase):
|
|||||||
with open(test_filename, "rb") as test_file:
|
with open(test_filename, "rb") as test_file:
|
||||||
test_file_contents = test_file.read()
|
test_file_contents = test_file.read()
|
||||||
# Read the response.
|
# 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["type"], "http.response.start")
|
||||||
self.assertEqual(response_start["status"], 200)
|
self.assertEqual(response_start["status"], 200)
|
||||||
headers = response_start["headers"]
|
headers = response_start["headers"]
|
||||||
|
Loading…
Reference in New Issue
Block a user