etwist/test/unittest_server.py
changeset 9533 fa4051e29fbe
parent 8752 e19f4bba89cd
child 9779 3f1685ac2f16
--- a/etwist/test/unittest_server.py	Thu Feb 13 16:50:55 2014 +0100
+++ b/etwist/test/unittest_server.py	Fri Feb 14 15:22:56 2014 +0100
@@ -17,6 +17,7 @@
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 
 import os, os.path as osp, glob
+import urllib
 
 from cubicweb.devtools.testlib import CubicWebTC
 from cubicweb.devtools.httptest import CubicWebServerTC
@@ -57,9 +58,14 @@
 
 class ETwistHTTPTC(CubicWebServerTC):
     def test_put_content(self):
-        body = 'hop'
+        data = {'hip': 'hop'}
+        headers = {'Content-Type': 'application/x-www-form-urlencoded'}
+        body = urllib.urlencode(data)
         response = self.web_request('?vid=put', method='PUT', body=body)
         self.assertEqual(body, response.body)
+        response = self.web_request('?vid=put', method='POST', body=body,
+                                    headers=headers)
+        self.assertEqual(body, response.body)
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main