Ticket #22003: test_broken_pipe.py
File test_broken_pipe.py, 395 bytes (added by , 11 years ago) |
---|
Line | |
---|---|
1 | import socket |
2 | from urlparse import urlparse |
3 | |
4 | from django.test import LiveServerTestCase |
5 | |
6 | class TestDBFailure(LiveServerTestCase): |
7 | |
8 | def test(self): |
9 | parsed_url = urlparse(self.live_server_url) |
10 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
11 | s.connect(('127.0.0.1', parsed_url.port)) |
12 | s.sendall('GET / HTTP/1.1\r\nHost: %s\r\n\r\n' % (parsed_url.hostname)) |