summaryrefslogtreecommitdiff
path: root/wsme/tests/test_restjson.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsme/tests/test_restjson.py')
-rw-r--r--wsme/tests/test_restjson.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/wsme/tests/test_restjson.py b/wsme/tests/test_restjson.py
index 4ed6423..3368703 100644
--- a/wsme/tests/test_restjson.py
+++ b/wsme/tests/test_restjson.py
@@ -254,6 +254,15 @@ class TestRestJson(wsme.tests.protocol.RestOnlyProtocolTestCase):
print(r)
assert json.loads(r.text) == 2
+ def test_invalid_content_type_body(self):
+ r = self.app.post('/argtypes/setint.json', '{"value": 2}',
+ headers={"Content-Type": "application/invalid"},
+ expect_errors=True)
+ print(r)
+ assert r.status_int == 415
+ assert json.loads(r.text)['faultstring'] == \
+ "Unknown mimetype: application/invalid"
+
def test_invalid_json_body(self):
r = self.app.post('/argtypes/setint.json', '{"value": 2',
headers={"Content-Type": "application/json"},