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
Ludovic Kiefer
erp5
Commits
8924f1f0
Commit
8924f1f0
authored
Aug 29, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to define list of bt to search, useful for testing template tool
parent
9f07d7d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+14
-6
No files found.
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
8924f1f0
...
@@ -541,28 +541,36 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
...
@@ -541,28 +541,36 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
DeprecationWarning
)
DeprecationWarning
)
return
self
.
createUserAssignment
(
user
,
assignment_kw
)
return
self
.
createUserAssignment
(
user
,
assignment_kw
)
def
setupAutomaticBusinessTemplateRepository
(
self
,
accept_public
=
True
):
def
setupAutomaticBusinessTemplateRepository
(
self
,
accept_public
=
True
,
searchable_business_template_list
=
None
):
# Try to setup some valid Repository List by reusing ERP5TypeTestCase API.
# Try to setup some valid Repository List by reusing ERP5TypeTestCase API.
# if accept_public we can accept public repository can be set, otherwise
# if accept_public we can accept public repository can be set, otherwise
# we let failure happens.
# we let failure happens.
if
searchable_business_template_list
is
None
:
searchable_business_template_list
=
[
"erp5_base"
]
# Assume that the public official repository is a valid repository
# Assume that the public official repository is a valid repository
public_bt5_repository_list
=
[
'http://www.erp5.org/dists/snapshot/bt5/'
]
public_bt5_repository_list
=
[
'http://www.erp5.org/dists/snapshot/bt5/'
]
template_list
=
self
.
_getBTPathAndIdList
([
"erp5_base"
])
template_list
=
[]
for
bt_id
in
searchable_business_template_list
:
bt_template_list
=
self
.
_getBTPathAndIdList
([
bt_id
])
if
len
(
bt_template_list
):
template_list
.
append
(
bt_template_list
[
0
])
if
len
(
template_list
)
>
0
:
if
len
(
template_list
)
>
0
:
bt5_repository_path
=
"/"
.
join
(
template_list
[
0
][
0
].
split
(
"/"
)[:
-
1
])
bt5_repository_path_list
=
[
"/"
.
join
(
x
[
0
].
split
(
"/"
)[:
-
1
])
for
x
in
template_list
]
if
accept_public
:
if
accept_public
:
try
:
try
:
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
[
bt5_repository_path
]
,
None
)
bt5_repository_path_list
,
None
)
except
(
RuntimeError
,
IOError
),
e
:
except
(
RuntimeError
,
IOError
),
e
:
# If bt5 repository is not a repository use public one.
# If bt5 repository is not a repository use public one.
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
public_bt5_repository_list
)
public_bt5_repository_list
)
else
:
else
:
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
[
bt5_repository_path
]
,
None
)
bt5_repository_path_list
,
None
)
elif
accept_public
:
elif
accept_public
:
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
self
.
portal
.
portal_templates
.
updateRepositoryBusinessTemplateList
(
public_bt5_repository_list
)
public_bt5_repository_list
)
...
...
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