[wsgi] Convert "code" passed to WSGIResponse as integer
WSGIResponse is passed a Request.status_out in
CubicWebWSGIApplication._render(), which, starting from Python 3.5, is
an instance of HTTPStatus.
However, webtest still expects a 3-digits value as status string.
Fortunately, calling int() on an HTTPStatus works.
--- a/cubicweb/wsgi/handler.py Wed Nov 29 15:50:07 2017 +0100
+++ b/cubicweb/wsgi/handler.py Wed Nov 29 16:14:57 2017 +0100
@@ -79,7 +79,7 @@
"""
def __init__(self, code, req, body=None):
text = STATUS_CODE_TEXT.get(code, 'UNKNOWN STATUS CODE')
- self.status = '%s %s' % (code, text)
+ self.status = '%d %s' % (code, text)
self.headers = list(chain(*[zip(repeat(k), v)
for k, v in req.headers_out.getAllRawHeaders()]))
self.headers = [(str(k), str(v)) for k, v in self.headers]