mirror of
https://github.com/django/django.git
synced 2025-11-27 05:52:41 +00:00
Refs #28440 -- Fixed server connection closing test on macOS.
This commit is contained in:
parent
ad8036d715
commit
32ade78c55
1 changed files with 2 additions and 1 deletions
|
|
@ -70,7 +70,8 @@ class LiveServerViews(LiveServerBase):
|
||||||
conn.request('GET', '/example_view/', headers={'Connection': 'keep-alive'})
|
conn.request('GET', '/example_view/', headers={'Connection': 'keep-alive'})
|
||||||
response = conn.getresponse().read()
|
response = conn.getresponse().read()
|
||||||
conn.request('GET', '/example_view/', headers={'Connection': 'close'})
|
conn.request('GET', '/example_view/', headers={'Connection': 'close'})
|
||||||
with self.assertRaises(RemoteDisconnected, msg='Server did not close the connection'):
|
# macOS may give ConnectionResetError.
|
||||||
|
with self.assertRaises((RemoteDisconnected, ConnectionResetError)):
|
||||||
try:
|
try:
|
||||||
conn.getresponse()
|
conn.getresponse()
|
||||||
except ConnectionAbortedError:
|
except ConnectionAbortedError:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue