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
Bryan Kaperick
erp5
Commits
1ba9bd01
Commit
1ba9bd01
authored
Mar 20, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Updated tests
parent
4df1d2db
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
42 deletions
+58
-42
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
...teItem/portal_components/test.erp5.testBusinessPackage.py
+25
-12
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.xml
...eItem/portal_components/test.erp5.testBusinessPackage.xml
+33
-30
No files found.
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
View file @
1ba9bd01
...
...
@@ -141,10 +141,12 @@ class TestBusinessPackage(ERP5TypeTestCase):
return
tuple
(
manager_list
)
def
_addFolderInERP5
(
self
):
def
_addFolderInERP5
(
self
,
id
=
None
):
"""
"""
test_folder
=
self
.
portal
.
newContent
(
id
=
'test_folder'
,
if
not
id
:
id
=
'test_folder'
test_folder
=
self
.
portal
.
newContent
(
id
=
id
,
portal_type
=
'Folder'
,
title
=
'couscous'
,
)
...
...
@@ -155,7 +157,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
# ********** TESTS FOR COMBINING MULTIPLE BUSINESS MANAGERS ************
#########################################################################
def
test
_combineBusinessItemWithDifferentSign
(
self
):
def
_combineBusinessItemWithDifferentSign
(
self
):
"""
Same path, same value, differernt sign
"""
...
...
@@ -180,7 +182,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerB
.
build
()
bm_list
=
[
managerA
,
managerB
]
combinedBM
=
portal_templates
.
combine
d
BusinessManager
(
bm_list
)
combinedBM
=
portal_templates
.
combine
Multiple
BusinessManager
(
bm_list
)
# ********** TESTS FOR DIFFERENT INSTALLATION USE CASES ************
#####################################################################
...
...
@@ -329,6 +331,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
def
test_useCase_V
(
self
):
"""
Case V:
_ A B: ??
"""
portal_templates
=
self
.
portal
.
portal_templates
managerA
=
self
.
_createBusinessManager
()
...
...
@@ -362,6 +365,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
installed_test_folder
=
self
.
portal
.
restrictedTraverse
(
folder_path
)
# XXX: What to expect: couscous or new_couscous? or conflict display
def
test_useCase_VI
(
self
):
...
...
@@ -425,17 +429,23 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new
.
build
()
managerA_new
.
setStatus
(
'uninstalled'
)
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),])
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),]
)
installed_test_folder
=
self
.
portal
.
restrictedTraverse
(
folder_path
)
self
.
assertEquals
(
installed_test_folder
.
getTitle
(),
'couscous'
)
managerA_new
,
=
self
.
_copyBusinessManager
([
managerA
.
id
,])
managerA_new
.
build
()
managerA_new
.
setStatus
(
'uninstalled'
)
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
installed_test_folder
.
getId
(),])
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
#
Expected undecided, if forced installation, then install test_folder,
# otherwise let the state of ZODB unchanged
#
This should install nothing as we prefer user changes
self
.
assertRaises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
folder_path
))
def
test_useCase_VIII
(
self
):
"""
...
...
@@ -461,7 +471,6 @@ class TestBusinessPackage(ERP5TypeTestCase):
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),])
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
installed_test_folder
=
self
.
portal
.
restrictedTraverse
(
folder_path
)
...
...
@@ -475,11 +484,11 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new
.
setStatus
(
'uninstalled'
)
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),])
self
.
portal
.
manage_delObjects
([
installed_
test_folder
.
getId
(),])
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
# Expected result undecide, if forced installation, then install the folder
# Expected result undecide
d
, if forced installation, then install the folder
# from updated Business Manager, otherwise let the user change in ZODB
# persist, i.e, no test_folder
...
...
@@ -686,6 +695,8 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new
.
build
()
managerA_new
.
setStatus
(
'uninstalled'
)
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),])
# Install the Business Manager
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
...
...
@@ -697,7 +708,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new
.
build
()
managerA_new
.
setStatus
(
'uninstalled'
)
test_folder
.
edit
(
title
=
'new_couscous'
)
installed_
test_folder
.
edit
(
title
=
'new_couscous'
)
# Install the Business Manager
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
...
...
@@ -728,6 +739,8 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new
.
build
()
managerA_new
.
setStatus
(
'uninstalled'
)
# Delete the object from ZODB so as we can install the object there
self
.
portal
.
manage_delObjects
([
test_folder
.
getId
(),])
# Install the Business Manager
portal_templates
.
installMultipleBusinessManager
([
managerA_new
,])
...
...
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.xml
View file @
1ba9bd01
This diff is collapsed.
Click to expand it.
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