Commit 4dcdc92e authored by Jérome Perrin's avatar Jérome Perrin

json_form: py3

parent 8405bcb4
......@@ -27,6 +27,7 @@
import json
from DateTime import DateTime
import six
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript
......@@ -149,6 +150,8 @@ return json.dumps({
self.fixJSONForm(method, schema, after_method)
self.tic()
self.assertRaises(ValueError, getattr(self.portal, method), json_data, list_error=True)
error = {"my-schema.json": [["Validation Error", "'2' is not of type 'integer'"], ["Validation Error", "2 is not of type 'string'"]]}
if six.PY2:
error = {"my-schema.json": [[u"Validation Error", u"'2' is not of type u'integer'"], [u"Validation Error", u"2 is not of type u'string'"]]}
try:
getattr(self.portal, method)(json_data, list_error=True)
......@@ -203,6 +206,12 @@ return json.dumps({
self.fixJSONForm(method, schema, after_method)
self.tic()
self.assertRaises(ValueError, getattr(self.portal, method), json_data, list_error=True)
error = {
"my-schema.json": [[
"Validation Error", u"'2018-11-13T20:20:67' is not a 'date-time'"
]]
}
if six.PY2:
error = {
"my-schema.json": [[
"Validation Error", u"'2018-11-13T20:20:67' is not a u'date-time'"
......
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