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
Frederic Thoma
erp5
Commits
a69bbd38
Commit
a69bbd38
authored
Feb 28, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Test case for global installation of multiple Business Manager objects
parent
01215ce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
1 deletion
+99
-1
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
...teItem/portal_components/test.erp5.testBusinessPackage.py
+99
-1
No files found.
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
View file @
a69bbd38
...
...
@@ -232,7 +232,105 @@ class TestBusinessPackage(ERP5TypeTestCase):
self
.
assertEquals
(
catalog_1
.
getTitle
(),
\
'Test Catalog 2 for Multiple BP5 Installation'
)
def
test_UpdateVersionOfBusinessManager
(
self
):
def
test_globalInstallationOfBusinessTemplate
(
self
):
"""
NOTE:
Keep in mind that the installation is done on build Business Manager
objects only, we are not yet exporting a Business Manager object
USE CASE:
* 2 bt5: A / B
* B has a path C
* install A and B
* you should have C in ZODB
* modify B to remove path C
* modify A to provide a path C (with a different content to simplify)
* update A and B
* C' should be in ZODB
EXPECTED RESULT:
Content of C': Something different than C, to be able to check
where C' is path C provided by A
"""
portal_templates
=
self
.
portal
.
portal_templates
managerA
=
self
.
_createBusinessManager
()
managerB
=
self
.
_createBusinessManager
()
test_catalog
=
self
.
portal
.
portal_catalog
.
newContent
(
portal_type
=
'Catalog'
,
title
=
'Test Catalog initial for Multiple BM Installation'
,
)
# Add catalog to the path list for Business Manager and build the object
catalog_path
=
test_catalog
.
getRelativeUrl
()
path_item_catalog
=
'%s | %s | %s'
%
(
catalog_path
,
1
,
1
)
path_item_list
=
[
path_item_catalog
]
# Set catalog path item as path_item in managerB
managerB
.
_setTemplatePathList
(
path_item_list
)
# Build both Business Manager(s)
built_manager_B
=
managerB
.
build
()
built_manager_A
=
managerA
.
build
()
# Delete the catalog object
self
.
portal
.
portal_catalog
.
manage_delObjects
(
[
test_catalog
.
getId
(),])
# Test that the catalog don't exist on site anymore
self
.
assertRaises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
catalog_path
))
# Install both the Business Manager(s)
portal_templates
.
installMultipleBusinessManager
([
built_manager_A
,
built_manager_B
])
# Test that the catalog exists on ZODB after installation
catalog
=
self
.
portal
.
restrictedTraverse
(
catalog_path
)
self
.
assertEquals
(
catalog
.
getTitle
(),
\
'Test Catalog initial for Multiple BM Installation'
)
# Remove the catalog_path from managerB
managerB
.
_setTemplatePathList
([])
# Edit the catalog
test_catalog
.
edit
(
title
=
'Edited version of Catalog for managerA'
)
# Add catalog_path to managerA
managerA
.
_setTemplatePathList
(
path_item_list
)
# Change Status for both Business Manager objects explicilty reason
# explained in NOTE in docstring for test
managerB
.
setStatus
(
'uninstalled'
)
managerA
.
setStatus
(
'uninstalled'
)
# Build both the Business Manager(s)
built_manager_B
=
managerB
.
build
()
built_manager_A
=
managerA
.
build
()
# Delete the catalog from the erp5 site
self
.
portal
.
portal_catalog
.
manage_delObjects
(
[
test_catalog
.
getId
(),])
# Test that the catalog don't exist on site anymore
self
.
assertRaises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
catalog_path
))
# Install both the Business Manager(s)
portal_templates
.
installMultipleBusinessManager
([
built_manager_A
,
built_manager_B
])
# Test that the catalog exists on ZODB after installation with the newer
# updated version
catalog
=
self
.
portal
.
restrictedTraverse
(
catalog_path
)
self
.
assertEquals
(
catalog
.
getTitle
(),
\
'Test Catalog initial for Multiple BM Installation'
)
def
_UpdateVersionOfBusinessManager
(
self
):
"""
* install bm A which add one workflow W1
* install bm B which surcharge workflow W2
...
...
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