wsgi/test/unittest_wsgi.py
author Christophe de Vienne <christophe@unlish.com>
Thu, 24 Jul 2014 20:53:21 +0200
changeset 9939 46a8ed48636f
child 9940 292f786009ba
permissions -rw-r--r--
[wsgi] Honor the 'CONTENT_TYPE' wsgi variable See http://legacy.python.org/dev/peps/pep-0333/#environ-variables Closes #4191812

import webtest.app

from cubicweb.devtools.webtest import CubicWebTestTC

from cubicweb.wsgi.request import CubicWebWsgiRequest


class WSGIAppTC(CubicWebTestTC):
    def test_content_type(self):
        r = webtest.app.TestRequest.blank('/', {'CONTENT_TYPE': 'text/plain'})

        req = CubicWebWsgiRequest(r.environ, self.vreg)

        self.assertEqual('text/plain', req.get_header('Content-Type'))