Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
45163410
Commit
45163410
authored
Feb 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json_form: py3
parent
fcb1ed95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
bt5/erp5_json_form/TestTemplateItem/portal_components/test.erp5.testJSONForm.py
...tTemplateItem/portal_components/test.erp5.testJSONForm.py
+11
-2
No files found.
bt5/erp5_json_form/TestTemplateItem/portal_components/test.erp5.testJSONForm.py
View file @
45163410
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
import
json
import
json
from
DateTime
import
DateTime
from
DateTime
import
DateTime
import
six
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
...
@@ -149,6 +150,8 @@ return json.dumps({
...
@@ -149,6 +150,8 @@ return json.dumps({
self
.
fixJSONForm
(
method
,
schema
,
after_method
)
self
.
fixJSONForm
(
method
,
schema
,
after_method
)
self
.
tic
()
self
.
tic
()
self
.
assertRaises
(
ValueError
,
getattr
(
self
.
portal
,
method
),
json_data
,
list_error
=
True
)
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'"
]]}
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
:
try
:
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
...
@@ -203,6 +206,12 @@ return json.dumps({
...
@@ -203,6 +206,12 @@ return json.dumps({
self
.
fixJSONForm
(
method
,
schema
,
after_method
)
self
.
fixJSONForm
(
method
,
schema
,
after_method
)
self
.
tic
()
self
.
tic
()
self
.
assertRaises
(
ValueError
,
getattr
(
self
.
portal
,
method
),
json_data
,
list_error
=
True
)
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
=
{
error
=
{
"my-schema.json"
:
[[
"my-schema.json"
:
[[
"Validation Error"
,
u"'2018-11-13T20:20:67' is not a u'date-time'"
"Validation Error"
,
u"'2018-11-13T20:20:67' is not a u'date-time'"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment