Commit ab5a3a07 authored by Romain Courteaud's avatar Romain Courteaud

erp5_json_rpc_api: stabilize test

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