wsgi/test/unittest_wsgi.py
changeset 9940 292f786009ba
parent 9939 46a8ed48636f
child 9941 8dc1c96d29f1
--- a/wsgi/test/unittest_wsgi.py	Thu Jul 24 20:53:21 2014 +0200
+++ b/wsgi/test/unittest_wsgi.py	Thu Jul 24 20:57:14 2014 +0200
@@ -1,4 +1,5 @@
 import webtest.app
+from StringIO import StringIO
 
 from cubicweb.devtools.webtest import CubicWebTestTC
 
@@ -12,3 +13,13 @@
         req = CubicWebWsgiRequest(r.environ, self.vreg)
 
         self.assertEqual('text/plain', req.get_header('Content-Type'))
+
+    def test_content_body(self):
+        r = webtest.app.TestRequest.blank('/', {
+            'CONTENT_LENGTH': 12,
+            'CONTENT_TYPE': 'text/plain',
+            'wsgi.input': StringIO('some content')})
+
+        req = CubicWebWsgiRequest(r.environ, self.vreg)
+
+        self.assertEqual('some content', req.content.read())