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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
a5fa0de5
Commit
a5fa0de5
authored
Feb 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json_form: py3
parent
7ca256cd
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 @
a5fa0de5
...
...
@@ -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'"
...
...
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