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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
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,
...
@@ -575,32 +575,35 @@ def testPortalTypeViewRecursivly(test_class, validator, module_id,
break
break
# create the object in portal_trash module
# create the object in portal_trash module
module_id
=
'portal_trash'
module_id
=
'portal_trash'
for
business_template_info
in
business_template_info_list
:
for
action_information
in
business_template_info
.
actions
[
portal_type
]:
if
portal_type
not
in
business_template_info
.
actions
:
if
(
action_information
[
'category'
]
in
(
'object_view'
,
'object_list'
)
and
continue
action_information
[
'visible'
]
==
1
and
for
action_information
in
business_template_info
.
actions
[
portal_type
]:
action_information
[
'text'
].
startswith
(
'string:${object_url}/'
)
and
if
(
action_information
[
'category'
]
in
(
'object_view'
,
'object_list'
)
and
len
(
action_information
[
'text'
].
split
(
'/'
))
==
2
):
action_information
[
'visible'
]
==
1
and
view_name
=
action_information
[
'text'
].
split
(
'/'
)[
-
1
].
split
(
'?'
)[
0
]
action_information
[
'action'
].
startswith
(
'string:${object_url}/'
)
and
method
=
makeTestMethod
(
validator
,
len
(
action_information
[
'action'
].
split
(
'/'
))
==
2
):
module_id
,
view_name
=
action_information
[
'action'
].
split
(
'/'
)[
-
1
].
split
(
'?'
)[
0
]
portal_path
,
method
=
makeTestMethod
(
validator
,
view_name
,
module_id
,
business_template_info
.
title
)
portal_path
,
method_name
=
(
'test_%s_%s_%s'
%
view_name
,
(
business_template_info
.
title
,
business_template_info
.
title
)
str
(
portal_type
).
replace
(
' '
,
'_'
),
# can be unicode
method_name
=
(
'test_%s_%s_%s'
%
view_name
))
(
business_template_info
.
title
,
method
.
__name__
=
method_name
str
(
portal_type
).
replace
(
' '
,
'_'
),
# can be unicode
setattr
(
test_class
,
method_name
,
method
)
view_name
))
module_id
=
backuped_module_id
method
.
__name__
=
method_name
business_template_info
=
backuped_business_template_info
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
# add the portal_type to the tested portal_types. This avoid to test many
# times a Portal Type wich is many bt.
# times a Portal Type wich is many bt.
tested_portal_type_list
.
append
(
portal_type
)
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
=
{}
new_portal_type_path_dict
=
{}
if
base_path
!=
''
:
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