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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
16d1b74b
Commit
16d1b74b
authored
Apr 19, 2021
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: Add a test to reproduce the draft view validation error
parent
f9288dbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
...portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
+1
-1
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
...plateItem/portal_components/test.erp5.testHalJsonStyle.py
+25
-0
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.xml
...lateItem/portal_components/test.erp5.testHalJsonStyle.xml
+5
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
View file @
16d1b74b
...
@@ -71,7 +71,7 @@ if dialog_method == 'Base_configureSortOn':
...
@@ -71,7 +71,7 @@ if dialog_method == 'Base_configureSortOn':
# Exceptions for Workflow
# Exceptions for Workflow
if
dialog_method
==
'Workflow_statusModify'
:
if
dialog_method
==
'Workflow_statusModify'
:
return
context
.
Workflow_statusModify
(
form_id
=
form_id
,
return
context
.
Workflow_statusModify
(
form_id
=
form_id
,
dialog_id
=
dialog_id
)
dialog_id
=
dialog_id
,
REQUEST
=
request
)
# Exception for edit relation
# Exception for edit relation
if
dialog_method
==
'Base_editRelation'
:
if
dialog_method
==
'Base_editRelation'
:
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
View file @
16d1b74b
...
@@ -709,6 +709,31 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -709,6 +709,31 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
document
.
getRelativeUrl
()))
document
.
getRelativeUrl
()))
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'method'
],
'POST'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'method'
],
'POST'
)
@
simulate
(
'Base_getRequestUrl'
,
'*args, **kwargs'
,
'return "http://example.org/bar"'
)
@
simulate
(
'Base_getRequestHeader'
,
'*args, **kwargs'
,
'return "application/hal+json"'
)
@
changeSkin
(
'Hal'
)
def
test_getHateoasDocument_draft_view
(
self
):
document
=
self
.
_makeDocument
()
fake_request
=
do_fake_request
(
"POST"
,
data
=
(
(
'field_your_comment'
,
''
),
(
'field_your_workflow_action'
,
'validate_action'
),
(
'selection_name'
,
'foo_selection'
),
))
response
=
document
.
Base_callDialogMethod
(
REQUEST
=
fake_request
,
dialog_method
=
'Workflow_statusModify'
,
dialog_id
=
'Base_viewWorkflowActionDialog'
,
form_id
=
'Foo_view'
,
)
fake_request
=
do_fake_request
(
"GET"
)
result
=
self
.
portal
.
web_site_module
.
hateoas
.
ERP5Document_getHateoas
(
REQUEST
=
fake_request
,
mode
=
"traverse"
,
relative_url
=
document
.
getRelativeUrl
(),
view
=
"view_draft"
)
@
simulate
(
'Base_getRequestUrl'
,
'*args, **kwargs'
,
@
simulate
(
'Base_getRequestUrl'
,
'*args, **kwargs'
,
'return "http://example.org/bar"'
)
'return "http://example.org/bar"'
)
@
simulate
(
'Base_getRequestHeader'
,
'*args, **kwargs'
,
@
simulate
(
'Base_getRequestHeader'
,
'*args, **kwargs'
,
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.xml
View file @
16d1b74b
...
@@ -45,7 +45,11 @@
...
@@ -45,7 +45,11 @@
<item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple/>
<tuple>
<string>
W:719, 4: Unused variable \'result\' (unused-variable)
</string>
<string>
W:736, 4: Unused variable \'response\' (unused-variable)
</string>
<string>
W:744, 4: Unused variable \'result\' (unused-variable)
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
...
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