get_wsgi_application() returns a functioning WSGI callable.
(self)
| 17 | self.addCleanup(request_started.connect, close_old_connections) |
| 18 | |
| 19 | def test_get_wsgi_application(self): |
| 20 | """ |
| 21 | get_wsgi_application() returns a functioning WSGI callable. |
| 22 | """ |
| 23 | application = get_wsgi_application() |
| 24 | |
| 25 | environ = self.request_factory._base_environ( |
| 26 | PATH_INFO="/", CONTENT_TYPE="text/html; charset=utf-8", REQUEST_METHOD="GET" |
| 27 | ) |
| 28 | |
| 29 | response_data = {} |
| 30 | |
| 31 | def start_response(status, headers): |
| 32 | response_data["status"] = status |
| 33 | response_data["headers"] = headers |
| 34 | |
| 35 | response = application(environ, start_response) |
| 36 | |
| 37 | self.assertEqual(response_data["status"], "200 OK") |
| 38 | self.assertEqual( |
| 39 | set(response_data["headers"]), |
| 40 | {("Content-Length", "12"), ("Content-Type", "text/html; charset=utf-8")}, |
| 41 | ) |
| 42 | self.assertIn( |
| 43 | bytes(response), |
| 44 | [ |
| 45 | b"Content-Length: 12\r\nContent-Type: text/html; " |
| 46 | b"charset=utf-8\r\n\r\nHello World!", |
| 47 | b"Content-Type: text/html; " |
| 48 | b"charset=utf-8\r\nContent-Length: 12\r\n\r\nHello World!", |
| 49 | ], |
| 50 | ) |
| 51 | |
| 52 | def test_wsgi_cookies(self): |
| 53 | response_data = {} |
nothing calls this directly
no test coverage detected