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
Kasra Jamshidi
erp5
Commits
8cca0237
Commit
8cca0237
authored
Jun 23, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Add tests for import export of Business Manager
parent
6455cd31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+45
-0
No files found.
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
8cca0237
...
...
@@ -29,6 +29,8 @@
import
unittest
import
sys
import
time
import
transaction
from
unittest
import
expectedFailure
from
Testing
import
ZopeTestCase
...
...
@@ -170,6 +172,49 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self
.
assertTrue
(
path
not
in
path_list
)
LOG
(
'checkRelativeUrlInSQLPathList not found path:'
,
0
,
path
)
def
test_00_exportNewBusinessManager
(
self
):
portal
=
self
.
getPortalObject
()
portal_templates
=
portal
.
portal_templates
portal_types
=
portal
.
portal_types
# Create the new base type and module based on it
base_type
=
self
.
portal
.
portal_types
.
newContent
(
id
=
'type_%s'
%
time
.
time
(),
portal_type
=
'Base Type'
,
type_class
=
'Folder'
,
)
self
.
tic
()
test_module
=
self
.
portal
.
newContent
(
id
=
'module_%s'
%
time
.
time
(),
portal_type
=
base_type
.
id
)
# Create a new manager and add path in the manager
manager
=
portal_templates
.
newContent
(
id
=
'test_manager'
,
portal_type
=
'Business Manager'
)
path_item_list
=
[
'portal_types/%s | 1 | 1'
%
base_type
.
id
,
'%s | 1 | 1'
%
test_module
.
id
,
]
manager
.
setProperty
(
'template_path_list'
,
path_item_list
)
manager
.
build
()
self
.
tic
()
self
.
manager_id
=
manager
.
id
# Export the manager
manager
.
export
(
'/srv/slapgrid/slappart16/srv/runner/instance/slappart6/tmp'
)
self
.
portal
.
manage_delObjects
([
'%s'
%
test_module
.
id
])
self
.
portal
.
portal_types
.
manage_delObjects
([
'%s'
%
base_type
.
id
])
portal_templates
.
_delOb
(
manager
.
id
)
transaction
.
commit
()
def
test_00_importNewBusinessManager
(
self
):
portal
=
self
.
getPortalObject
()
portal_templates
=
portal
.
portal_templates
imported_manager
=
portal_templates
.
_importObjectFromFile
(
'/srv/slapgrid/slappart16/srv/runner/instance/slappart6/tmp/test_manager.zexp'
)
def
test_01_HasEverything
(
self
):
self
.
assertNotEquals
(
self
.
getCategoryTool
(),
None
)
self
.
assertNotEquals
(
self
.
getSimulationTool
(),
None
)
...
...
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