[wsgi] Add missing import
authorChristophe de Vienne <christophe@unlish.com>
Tue, 02 Sep 2014 10:31:13 +0200
changeset 9942 4b99196102f0
parent 9941 8dc1c96d29f1
child 9943 a4aeee690bff
[wsgi] Add missing import Closes #4305988
wsgi/request.py
wsgi/test/unittest_wsgi.py
--- a/wsgi/request.py	Tue Sep 02 10:30:28 2014 +0200
+++ b/wsgi/request.py	Tue Sep 02 10:31:13 2014 +0200
@@ -25,6 +25,8 @@
 
 __docformat__ = "restructuredtext en"
 
+import tempfile
+
 from StringIO import StringIO
 from urllib import quote
 from urlparse import parse_qs
--- a/wsgi/test/unittest_wsgi.py	Tue Sep 02 10:30:28 2014 +0200
+++ b/wsgi/test/unittest_wsgi.py	Tue Sep 02 10:31:13 2014 +0200
@@ -48,6 +48,17 @@
 
         self.assertTrue(req.https)
 
+    def test_big_content(self):
+        content = 'x'*100001
+        r = webtest.app.TestRequest.blank('/', {
+            'CONTENT_LENGTH': len(content),
+            'CONTENT_TYPE': 'text/plain',
+            'wsgi.input': StringIO(content)})
+
+        req = CubicWebWsgiRequest(r.environ, self.vreg)
+
+        self.assertEqual(content, req.content.read())
+
     @classmethod
     def init_config(cls, config):
         super(WSGIAppTC, cls).init_config(config)