mirror of https://github.com/django/django.git
[2.0.x] Refs #28440 -- Fixed server connection closing test on macOS.
Backport of 32ade78c55
from master
This commit is contained in:
parent
8b42a18b2d
commit
73d025a042
|
@ -75,7 +75,8 @@ class LiveServerViews(LiveServerBase):
|
|||
conn.request('GET', '/example_view/', headers={'Connection': 'keep-alive'})
|
||||
response = conn.getresponse().read()
|
||||
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:
|
||||
conn.getresponse()
|
||||
except ConnectionAbortedError:
|
||||
|
|
Loading…
Reference in New Issue