[wsgi] Set self.vreg
authorChristophe de Vienne <christophe@unlish.com>
Tue, 02 Sep 2014 13:00:47 +0200
changeset 9943 a4aeee690bff
parent 9942 4b99196102f0
child 9944 9b3b21b7ff3e
[wsgi] Set self.vreg Closes #4306049
wsgi/request.py
wsgi/test/unittest_wsgi.py
--- a/wsgi/request.py	Tue Sep 02 10:31:13 2014 +0200
+++ b/wsgi/request.py	Tue Sep 02 13:00:47 2014 +0200
@@ -41,6 +41,10 @@
     """
 
     def __init__(self, environ, vreg):
+        # self.vreg is used in get_posted_data, which is called before the
+        # parent constructor.
+        self.vreg = vreg
+
         self.environ = environ
         self.path = environ['PATH_INFO']
         self.method = environ['REQUEST_METHOD'].upper()
--- a/wsgi/test/unittest_wsgi.py	Tue Sep 02 10:31:13 2014 +0200
+++ b/wsgi/test/unittest_wsgi.py	Tue Sep 02 13:00:47 2014 +0200
@@ -59,6 +59,11 @@
 
         self.assertEqual(content, req.content.read())
 
+    def test_post(self):
+        self.webapp.post(
+            '/',
+            params={'__login': self.admlogin, '__password': self.admpassword})
+
     @classmethod
     def init_config(cls, config):
         super(WSGIAppTC, cls).init_config(config)