Commit 988b227d authored by Romain Courteaud's avatar Romain Courteaud

erp5_json_rpc_api: fix tests

parent c781a8aa
...@@ -149,9 +149,9 @@ class TestJsonRpcAPIConnectorView(JsonRpcAPITestCase): ...@@ -149,9 +149,9 @@ class TestJsonRpcAPIConnectorView(JsonRpcAPITestCase):
self.assertEqual(ret.getBody(), b'Pet Store') self.assertEqual(ret.getBody(), b'Pet Store')
def test_portal_skins_acquisition(self): def test_portal_skins_acquisition(self):
self.assertEqual(self.connector.OpenAPIService_view.getId(), 'OpenAPIService_view') self.assertEqual(self.connector.JsonRpcService_view.getId(), 'JsonRpcService_view')
ret = self.publish( ret = self.publish(
self.connector.getPath() + '/OpenAPIService_view', user='ERP5TypeTestCase') self.connector.getPath() + '/JsonRpcService_view', user='ERP5TypeTestCase')
self.assertEqual(ret.getStatus(), 200) self.assertEqual(ret.getStatus(), 200)
self.assertNotIn(b'Site Error', ret.getBody()) self.assertNotIn(b'Site Error', ret.getBody())
...@@ -162,6 +162,12 @@ class TestJsonRpcAPIConnectorView(JsonRpcAPITestCase): ...@@ -162,6 +162,12 @@ class TestJsonRpcAPIConnectorView(JsonRpcAPITestCase):
self.connector.getPath() + '/non_existing_attribute', self.connector.getPath() + '/non_existing_attribute',
user='ERP5TypeTestCase') user='ERP5TypeTestCase')
self.assertEqual(ret.getStatus(), 404) self.assertEqual(ret.getStatus(), 404)
self.assertEqual(ret.getHeader('content-type'), 'application/json')
self.assertEqual(
json.loads(ret.getBody()), {
"type": "not-found",
"title": 'non_existing_attribute'
})
class TestJsonRpcAPIErrorHandling(JsonRpcAPITestCase): class TestJsonRpcAPIErrorHandling(JsonRpcAPITestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment