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
143
Merge Requests
143
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
d42dc551
Commit
d42dc551
authored
Feb 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json_form: py3
parent
93b00390
Changes
1
Hide 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 @
d42dc551
...
...
@@ -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,7 +150,9 @@ 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"
:
[[
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"
:
[[
"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
)
raise
ValueError
(
"No error raised during processing"
)
...
...
@@ -205,9 +208,15 @@ return json.dumps({
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
u
'date-time'"
"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'"
]]
}
try
:
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
raise
ValueError
(
"No error raised during processing"
)
...
...
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