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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
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
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 @
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,7 +150,9 @@ return json.dumps({
...
@@ -149,7 +150,9 @@ 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"
:
[[
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
:
try
:
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
raise
ValueError
(
"No error raised during processing"
)
raise
ValueError
(
"No error raised during processing"
)
...
@@ -205,9 +208,15 @@ return json.dumps({
...
@@ -205,9 +208,15 @@ return json.dumps({
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
=
{
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 'date-time'"
]]
]]
}
}
if
six
.
PY2
:
error
=
{
"my-schema.json"
:
[[
"Validation Error"
,
u"'2018-11-13T20:20:67' is not a u'date-time'"
]]
}
try
:
try
:
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
getattr
(
self
.
portal
,
method
)(
json_data
,
list_error
=
True
)
raise
ValueError
(
"No error raised during processing"
)
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