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
Titouan Soulard
erp5
Commits
121a86d8
Commit
121a86d8
authored
Aug 11, 2023
by
Emmy Vouriot
Committed by
Jérome Perrin
Aug 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test bytes to str when concat with str
parent
5ae9f321
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
bt5/erp5_api_style/TestTemplateItem/portal_components/test.erp5.testJioApiStyle.py
...mplateItem/portal_components/test.erp5.testJioApiStyle.py
+12
-12
No files found.
bt5/erp5_api_style/TestTemplateItem/portal_components/test.erp5.testJioApiStyle.py
View file @
121a86d8
...
@@ -403,7 +403,7 @@ return json.dumps({
...
@@ -403,7 +403,7 @@ return json.dumps({
self
.
assertEqual
(
404
,
result
[
u"status"
])
self
.
assertEqual
(
404
,
result
[
u"status"
])
self
.
assertEqual
(
u"API-DOCUMENT-NOT-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-DOCUMENT-NOT-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"Document has not been found"
,
result
[
u"message"
])
self
.
assertEqual
(
u"Document has not been found"
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-DOCUMENT-NOT-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-DOCUMENT-NOT-FOUND"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Document has not been found"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Document has not been found"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -424,7 +424,7 @@ return json.dumps({
...
@@ -424,7 +424,7 @@ return json.dumps({
self
.
assertEqual
(
400
,
result
[
u"status"
])
self
.
assertEqual
(
400
,
result
[
u"status"
])
self
.
assertEqual
(
u"API-JSON-NO-ID-PROPERTY"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-JSON-NO-ID-PROPERTY"
,
result
[
u"name"
])
self
.
assertEqual
(
u"Cannot find id property"
,
result
[
u"message"
])
self
.
assertEqual
(
u"Cannot find id property"
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-JSON-NO-ID-PROPERTY"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-JSON-NO-ID-PROPERTY"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Cannot find id property"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Cannot find id property"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -447,9 +447,9 @@ return json.dumps({
...
@@ -447,9 +447,9 @@ return json.dumps({
self
.
action_type_dict
[
"get"
],
person
.
getRelativeUrl
())
self
.
action_type_dict
[
"get"
],
person
.
getRelativeUrl
())
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
message
.
encode
(
))
self
.
assertEqual
(
error_record
.
getDescription
(),
(
message
.
encode
()
if
six
.
PY2
else
message
))
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
def
test_action_get_bad_json
(
self
):
def
test_action_get_bad_json
(
self
):
...
@@ -513,7 +513,7 @@ return json.dumps({
...
@@ -513,7 +513,7 @@ return json.dumps({
self
.
assertEqual
(
404
,
result
[
u"status"
])
self
.
assertEqual
(
404
,
result
[
u"status"
])
self
.
assertEqual
(
u"API-DOCUMENT-NOT-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-DOCUMENT-NOT-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"Document has not been found"
,
result
[
u"message"
])
self
.
assertEqual
(
u"Document has not been found"
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-DOCUMENT-NOT-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-DOCUMENT-NOT-FOUND"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Document has not been found"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Document has not been found"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -533,7 +533,7 @@ return json.dumps({
...
@@ -533,7 +533,7 @@ return json.dumps({
self
.
assertEqual
(
400
,
result
[
u"status"
])
self
.
assertEqual
(
400
,
result
[
u"status"
])
self
.
assertEqual
(
u"API-JSON-NO-ID-PROPERTY"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-JSON-NO-ID-PROPERTY"
,
result
[
u"name"
])
self
.
assertEqual
(
u"Cannot find id property"
,
result
[
u"message"
])
self
.
assertEqual
(
u"Cannot find id property"
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-JSON-NO-ID-PROPERTY"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-JSON-NO-ID-PROPERTY"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Cannot find id property"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
"Cannot find id property"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -555,9 +555,9 @@ return json.dumps({
...
@@ -555,9 +555,9 @@ return json.dumps({
self
.
action_type_dict
[
"put"
],
person
.
getRelativeUrl
())
self
.
action_type_dict
[
"put"
],
person
.
getRelativeUrl
())
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getDescription
(),
message
.
encode
(
))
self
.
assertEqual
(
error_record
.
getDescription
(),
(
message
.
encode
()
if
six
.
PY2
else
message
))
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
def
test_action_put_bad_json
(
self
):
def
test_action_put_bad_json
(
self
):
...
@@ -697,7 +697,7 @@ return json.dumps({
...
@@ -697,7 +697,7 @@ return json.dumps({
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -728,7 +728,7 @@ return json.dumps({
...
@@ -728,7 +728,7 @@ return json.dumps({
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -981,7 +981,7 @@ return [{
...
@@ -981,7 +981,7 @@ return [{
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
details
,
result
[
u"details"
])
self
.
assertEqual
(
details
,
result
[
u"details"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
@@ -1012,7 +1012,7 @@ return [{
...
@@ -1012,7 +1012,7 @@ return [{
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
u"API-NO-ACTION-FOUND"
,
result
[
u"name"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
message
,
result
[
u"message"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
self
.
assertEqual
(
details_list
,
result
[
u"details"
])
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
result
[
u"debug_id"
].
encode
(
))
error_record
=
self
.
portal
.
restrictedTraverse
(
"error_record_module/"
+
(
result
[
u"debug_id"
].
encode
()
if
six
.
PY2
else
result
[
"debug_id"
]
))
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTitle
(),
"API-NO-ACTION-FOUND"
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
self
.
assertEqual
(
error_record
.
getTextContent
(),
json_payload
)
...
...
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