# HG changeset patch # User Denis Laxalde # Date 1511968497 -3600 # Node ID 55924e962cd7190f5d060722f50eac6d30552deb # Parent 93dc77e9da778fe5bc1af7367360cc6983cf8b84 [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. diff -r 93dc77e9da77 -r 55924e962cd7 cubicweb/wsgi/handler.py --- 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]