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
Laurent S
erp5
Commits
c107fb71
Commit
c107fb71
authored
Mar 09, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_hal_json_style] Do not harcode domain/port
parent
e4bfb062
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
+42
-42
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
...plateItem/portal_components/test.erp5.testHalJsonStyle.py
+42
-42
No files found.
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
View file @
c107fb71
...
@@ -250,22 +250,22 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
...
@@ -250,22 +250,22 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
"
http://nohost/
%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
"
http://nohost/
%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
"
http://nohost/
%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
"%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
...
@@ -278,8 +278,8 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
...
@@ -278,8 +278,8 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
document
.
getPortalObject
().
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
document
.
getPortalObject
().
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
"
http://nohost/
%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
"%s/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
...
@@ -311,22 +311,22 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
...
@@ -311,22 +311,22 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=embed_action"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=embed_action"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Embed"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Embed"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"embed_action"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"embed_action"
)
...
@@ -338,8 +338,8 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
...
@@ -338,8 +338,8 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
document
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
document
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
...
@@ -348,12 +348,12 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
...
@@ -348,12 +348,12 @@ class TestERP5Document_getHateoas_mode_root(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_links'
][
'type'
][
'name'
],
document
.
getPortalType
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'type'
][
'name'
],
document
.
getPortalType
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'href'
],
"
http://nohost/%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=search{&query,select_list*,limit*}"
%
self
.
portal
.
getId
())
"
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=search{&query,select_list*,limit*}"
%
self
.
portal
.
absolute_url
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'templated'
],
True
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'templated'
],
True
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'name'
],
"Raw Search"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'raw_search'
][
'name'
],
"Raw Search"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'href'
],
"
http://nohost/%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse{&relative_url,view}"
%
self
.
portal
.
getId
())
"
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse{&relative_url,view}"
%
self
.
portal
.
absolute_url
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'templated'
],
True
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'templated'
],
True
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'name'
],
"Traverse"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'traverse'
][
'name'
],
"Traverse"
)
...
@@ -397,22 +397,22 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -397,22 +397,22 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
...
@@ -424,8 +424,8 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -424,8 +424,8 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
self
.
portal
.
web_site_module
.
hateoas
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
self
.
portal
.
web_site_module
.
hateoas
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
...
@@ -457,22 +457,22 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -457,22 +457,22 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
{
"href"
:
"urn:jio:get:%s"
%
parent
.
getRelativeUrl
(),
"name"
:
parent
.
getTitle
()})
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"View"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"view"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=custom_action_no_dialog"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'title'
],
"Custom Action No Dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_workflow'
][
0
][
'name'
],
"custom_action_no_dialog"
)
...
@@ -484,8 +484,8 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -484,8 +484,8 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
self
.
portal
.
web_site_module
.
hateoas
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'site_root'
][
'name'
],
self
.
portal
.
web_site_module
.
hateoas
.
getTitle
())
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=create_a_document"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
urllib
.
quote_plus
(
document
.
getRelativeUrl
())))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'title'
],
"Create a Document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_new_content_action'
][
'name'
],
"create_a_document"
)
...
@@ -516,15 +516,15 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -516,15 +516,15 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'traversed_document'
][
'name'
],
document
.
getRelativeUrl
())
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'traversed_document'
][
'name'
],
document
.
getRelativeUrl
())
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'traversed_document'
][
'title'
],
document
.
getTitle
().
decode
(
"UTF-8"
))
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'traversed_document'
][
'title'
],
document
.
getTitle
().
decode
(
"UTF-8"
))
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'self'
][
'href'
],
"
http://nohost/
%s/%s/Foo_view"
%
(
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'self'
][
'href'
],
"%s/%s/Foo_view"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
document
.
getRelativeUrl
()))
document
.
getRelativeUrl
()))
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'form_definition'
][
'href'
],
'urn:jio:get:portal_skins/erp5_ui_test/Foo_view'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'form_definition'
][
'href'
],
'urn:jio:get:portal_skins/erp5_ui_test/Foo_view'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'form_definition'
][
'name'
],
'Foo_view'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_links'
][
'form_definition'
][
'name'
],
'Foo_view'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'href'
],
'
http://nohost/
%s/web_site_module/hateoas/%s/Base_edit'
%
(
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'href'
],
'%s/web_site_module/hateoas/%s/Base_edit'
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
document
.
getRelativeUrl
()))
document
.
getRelativeUrl
()))
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'method'
],
'POST'
)
self
.
assertEqual
(
result_dict
[
'_embedded'
][
'_view'
][
'_actions'
][
'put'
][
'method'
],
'POST'
)
...
@@ -548,15 +548,15 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
...
@@ -548,15 +548,15 @@ class TestERP5Document_getHateoas_mode_traverse(ERP5HALJSONStyleSkinsMixin):
{
"href"
:
"urn:jio:get:"
,
"name"
:
self
.
portal
.
getTitle
()})
{
"href"
:
"urn:jio:get:"
,
"name"
:
self
.
portal
.
getTitle
()})
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=consistency"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=consistency"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
"portal_skins/erp5_ui_test/Foo_view"
)))
urllib
.
quote_plus
(
"portal_skins/erp5_ui_test/Foo_view"
)))
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"Consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'title'
],
"Consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'view'
][
0
][
'name'
],
"consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'href'
],
"
http://nohost/
%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=consistency"
%
(
"%s/web_site_module/hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=%s&view=consistency"
%
(
self
.
portal
.
getId
(),
self
.
portal
.
absolute_url
(),
urllib
.
quote_plus
(
"portal_skins/erp5_ui_test/Foo_view"
)))
urllib
.
quote_plus
(
"portal_skins/erp5_ui_test/Foo_view"
)))
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"Consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'title'
],
"Consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"consistency"
)
self
.
assertEqual
(
result_dict
[
'_links'
][
'action_object_view'
][
0
][
'name'
],
"consistency"
)
...
...
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