Ticket #22003: test_broken_pipe.py

File test_broken_pipe.py, 395 bytes (added by garron, 18 months ago)

Test that demonstrates issue

Line 
1import socket
2from urlparse import urlparse
3
4from django.test import LiveServerTestCase
5
6class 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))
Back to Top