Commit ab5a3a07 authored by Romain Courteaud's avatar Romain Courteaud

erp5_json_rpc_api: stabilize test

parent c369d015
......@@ -28,6 +28,7 @@
import io
import json
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.document.OpenAPITypeInformation import byteify
class JsonRpcAPITestCase(ERP5TypeTestCase):
......@@ -895,13 +896,12 @@ class TestJsonRpcAPIJsonFormHandling(JsonRpcAPITestCase):
self.assertEqual(response.getStatus(), 200)
self.assertEqual(response.getHeader('content-type'), 'application/json')
self.assertEqual(
response.getBody(),
json.dumps(
{
'type': 'success-type',
'title': "query completed",
'status': 200
}).encode())
byteify(json.loads(response.getBody())),
{
'type': 'success-type',
'title': "query completed",
'status': 200
})
def test_jsonFormHandling_noInputSchemaAndBodyContent(self):
self.addJSONForm(
......@@ -918,13 +918,12 @@ class TestJsonRpcAPIJsonFormHandling(JsonRpcAPITestCase):
self.assertEqual(response.getStatus(), 200)
self.assertEqual(response.getHeader('content-type'), 'application/json')
self.assertEqual(
response.getBody(),
json.dumps(
{
'type': 'success-type',
'title': "query completed",
'status': 200
}).encode())
byteify(json.loads(response.getBody())),
{
'type': 'success-type',
'title': "query completed",
'status': 200
})
def test_jsonFormHandling_invalidBodyContent(self):
self.addJSONForm(
......
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