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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
b870faab
Commit
b870faab
authored
Sep 06, 2013
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test to interact in all Business Templates to find actions and allowed content types
parent
b8ef41df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+24
-21
No files found.
product/ERP5/tests/testXHTML.py
View file @
b870faab
...
...
@@ -575,32 +575,35 @@ def testPortalTypeViewRecursivly(test_class, validator, module_id,
break
# create the object in portal_trash module
module_id
=
'portal_trash'
for
action_information
in
business_template_info
.
actions
[
portal_type
]:
if
(
action_information
[
'category'
]
in
(
'object_view'
,
'object_list'
)
and
action_information
[
'visible'
]
==
1
and
action_information
[
'text'
].
startswith
(
'string:${object_url}/'
)
and
len
(
action_information
[
'text'
].
split
(
'/'
))
==
2
):
view_name
=
action_information
[
'text'
].
split
(
'/'
)[
-
1
].
split
(
'?'
)[
0
]
method
=
makeTestMethod
(
validator
,
module_id
,
portal_path
,
view_name
,
business_template_info
.
title
)
method_name
=
(
'test_%s_%s_%s'
%
(
business_template_info
.
title
,
str
(
portal_type
).
replace
(
' '
,
'_'
),
# can be unicode
view_name
))
method
.
__name__
=
method_name
setattr
(
test_class
,
method_name
,
method
)
module_id
=
backuped_module_id
business_template_info
=
backuped_business_template_info
for
business_template_info
in
business_template_info_list
:
if
portal_type
not
in
business_template_info
.
actions
:
continue
for
action_information
in
business_template_info
.
actions
[
portal_type
]:
if
(
action_information
[
'category'
]
in
(
'object_view'
,
'object_list'
)
and
action_information
[
'visible'
]
==
1
and
action_information
[
'action'
].
startswith
(
'string:${object_url}/'
)
and
len
(
action_information
[
'action'
].
split
(
'/'
))
==
2
):
view_name
=
action_information
[
'action'
].
split
(
'/'
)[
-
1
].
split
(
'?'
)[
0
]
method
=
makeTestMethod
(
validator
,
module_id
,
portal_path
,
view_name
,
business_template_info
.
title
)
method_name
=
(
'test_%s_%s_%s'
%
(
business_template_info
.
title
,
str
(
portal_type
).
replace
(
' '
,
'_'
),
# can be unicode
view_name
))
method
.
__name__
=
method_name
setattr
(
test_class
,
method_name
,
method
)
module_id
=
backuped_module_id
# add the portal_type to the tested portal_types. This avoid to test many
# times a Portal Type wich is many bt.
tested_portal_type_list
.
append
(
portal_type
)
new_portal_type_list
=
business_template_info
.
allowed_content_types
.
get
(
portal_type
,
())
new_portal_type_list
=
[]
for
tmp_business_template_info
in
business_template_info_list
:
new_portal_type_list
.
extend
(
tmp_business_template_info
.
allowed_content_types
.
get
(
portal_type
,
()))
new_portal_type_path_dict
=
{}
if
base_path
!=
''
:
...
...
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