--- a/wsgi/test/unittest_wsgi.py Mon Sep 01 14:56:00 2014 +0200
+++ b/wsgi/test/unittest_wsgi.py Mon Sep 15 17:23:22 2014 +0200
@@ -6,6 +6,7 @@
from cubicweb.devtools.webtest import CubicWebTestTC
from cubicweb.wsgi.request import CubicWebWsgiRequest
+from cubicweb.multipart import MultipartError
class WSGIAppTC(CubicWebTestTC):
@@ -66,6 +67,19 @@
'/',
params={'__login': self.admlogin, '__password': self.admpassword})
+ def test_post_bad_form(self):
+ with self.assertRaises(MultipartError):
+ self.webapp.post(
+ '/',
+ params='badcontent',
+ headers={'Content-Type': 'multipart/form-data'})
+
+ def test_post_non_form(self):
+ self.webapp.post(
+ '/',
+ params='{}',
+ headers={'Content-Type': 'application/json'})
+
def test_get_multiple_variables(self):
r = webtest.app.TestRequest.blank('/?arg=1&arg=2')
req = CubicWebWsgiRequest(r.environ, self.vreg)