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
amrani
erp5
Commits
3a3811b1
Commit
3a3811b1
authored
Apr 30, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hal_json_style]: Add case for no link for URL columns
Also, remove the test from expected Failure for this case.
parent
f15499b2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+4
-0
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
...plateItem/portal_components/test.erp5.testHalJsonStyle.py
+2
-2
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
3a3811b1
...
@@ -1963,6 +1963,10 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1963,6 +1963,10 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
selection_name
=
catalog_kw
[
'selection_name'
],
selection_name
=
catalog_kw
[
'selection_name'
],
column_id
=
select
)
column_id
=
select
)
except
AttributeError
as
e
:
except
AttributeError
as
e
:
# In case the URL method is invalid or empty, we expect to have no link
# for the column to maintain compatibility with old UI, hence we create
# an empty url_parameter_dict for these cases.
url_parameter_dict
=
{}
if
url_column_dict
[
select
]:
if
url_column_dict
[
select
]:
log
(
"Invalid URL method {!s} on column {}"
.
format
(
url_column_dict
[
select
],
select
),
level
=
800
)
log
(
"Invalid URL method {!s} on column {}"
.
format
(
url_column_dict
[
select
],
select
),
level
=
800
)
...
...
bt5/erp5_hal_json_style/TestTemplateItem/portal_components/test.erp5.testHalJsonStyle.py
View file @
3a3811b1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
import
transaction
import
transaction
from
zExceptions
import
Unauthorized
from
zExceptions
import
Unauthorized
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
unittest
import
skip
,
expectedFailure
from
unittest
import
skip
from
functools
import
wraps
from
functools
import
wraps
from
ZPublisher.HTTPRequest
import
HTTPRequest
from
ZPublisher.HTTPRequest
import
HTTPRequest
...
@@ -1378,7 +1378,6 @@ return url
...
@@ -1378,7 +1378,6 @@ return url
self
.
portal
.
foo_module
.
FooModule_viewFooList
.
listbox
.
ListBox_setPropertyList
(
self
.
portal
.
foo_module
.
FooModule_viewFooList
.
listbox
.
ListBox_setPropertyList
(
field_url_columns
=
''
)
field_url_columns
=
''
)
@
expectedFailure
@
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'
,
...
@@ -1386,6 +1385,7 @@ return url
...
@@ -1386,6 +1385,7 @@ return url
@
simulate
(
'Test_listProducts'
,
'*args, **kwargs'
,
"""
@
simulate
(
'Test_listProducts'
,
'*args, **kwargs'
,
"""
return context.getPortalObject().foo_module.contentValues()
return context.getPortalObject().foo_module.contentValues()
"""
)
"""
)
@
changeSkin
(
'Hal'
)
def
test_getHateoasDocument_listbox_check_url_column_no_url
(
self
):
def
test_getHateoasDocument_listbox_check_url_column_no_url
(
self
):
# pass custom list method which expect input arguments
# pass custom list method which expect input arguments
self
.
portal
.
foo_module
.
FooModule_viewFooList
.
listbox
.
ListBox_setPropertyList
(
self
.
portal
.
foo_module
.
FooModule_viewFooList
.
listbox
.
ListBox_setPropertyList
(
...
...
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