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
Matevz Golob
erp5
Commits
769dd716
Commit
769dd716
authored
Jan 05, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Update bt5 list in portal_component tests
parent
b28e5e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
...teItem/portal_components/test.erp5.testBusinessPackage.py
+10
-8
No files found.
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
View file @
769dd716
...
@@ -52,6 +52,8 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -52,6 +52,8 @@ class TestBusinessPackage(ERP5TypeTestCase):
"""
"""
return
(
return
(
'erp5_base'
,
'erp5_base'
,
'erp5_core'
,
'erp5_property_sheets'
,
'erp5_business_package'
,
'erp5_business_package'
,
)
)
...
@@ -62,7 +64,6 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -62,7 +64,6 @@ class TestBusinessPackage(ERP5TypeTestCase):
# here, you can create the categories and objects your test will depend on
# here, you can create the categories and objects your test will depend on
#self.export_dir = tempfile.mkdtmp(dir=tests_home)
#self.export_dir = tempfile.mkdtmp(dir=tests_home)
self
.
portal
=
self
.
getPortalObject
()
self
.
portal
=
self
.
getPortalObject
()
self
.
package
=
self
.
_createBusinessPackage
()
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
try
:
try
:
...
@@ -82,7 +83,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -82,7 +83,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
description
=
'package for live test'
)
description
=
'package for live test'
)
return
package
return
package
def
_buildAndExportBusinessPackage
(
self
):
def
_buildAndExportBusinessPackage
(
self
,
package
):
"""
"""
Builds and exports Business Package to a given export directory
Builds and exports Business Package to a given export directory
"""
"""
...
@@ -90,24 +91,25 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -90,24 +91,25 @@ class TestBusinessPackage(ERP5TypeTestCase):
# Expected result should be while building the path object items
# Expected result should be while building the path object items
# are going to be exported as XML(?)
# are going to be exported as XML(?)
self
.
tic
()
self
.
tic
()
self
.
built_package
=
self
.
package
.
build
()
package
.
build
()
self
.
tic
()
self
.
tic
()
# Export package (not needed)
# Export package (not needed)
#self.package.export(path=self.export_dir, local=True)
#self.package.export(path=self.export_dir, local=True)
#self.tic()
#self.tic()
def
_installBusinessPackage
(
self
):
def
_installBusinessPackage
(
self
,
package
):
"""
"""
Install the package from its built version.
Install the package from its built version.
Expected to install the PathTemplateObject items
Expected to install the PathTemplateObject items
"""
"""
self
.
package
.
install
()
package
.
install
()
def
test_fileImportAndReinstallForDocument
(
self
):
def
test_fileImportAndReinstallForDocument
(
self
):
"""
"""
Test Business Package build and install with test document
Test Business Package build and install with test document
"""
"""
package
=
self
.
_createBusinessPackage
()
document_file
=
self
.
portal
.
document_module
.
newContent
(
document_file
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'File'
,
portal_type
=
'File'
,
title
=
'Test Document'
,
title
=
'Test Document'
,
...
@@ -117,10 +119,10 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -117,10 +119,10 @@ class TestBusinessPackage(ERP5TypeTestCase):
self
.
tic
()
self
.
tic
()
file_path
=
document_file
.
getRelativeUrl
()
file_path
=
document_file
.
getRelativeUrl
()
self
.
package
.
edit
(
template_path_list
=
[
file_path
,])
package
.
edit
(
template_path_list
=
[
file_path
,])
# Build package
# Build package
self
.
_buildAndExportBusinessPackage
()
self
.
_buildAndExportBusinessPackage
(
package
)
# Delete document from site
# Delete document from site
self
.
portal
.
document_module
.
manage_delObjects
([
document_file
.
getId
(),])
self
.
portal
.
document_module
.
manage_delObjects
([
document_file
.
getId
(),])
...
@@ -130,7 +132,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
...
@@ -130,7 +132,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
self
.
assertRaises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
file_path
))
self
.
assertRaises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
file_path
))
# Install package
# Install package
self
.
_installBusinessPackage
()
self
.
_installBusinessPackage
(
package
)
# Test if the file is back
# Test if the file is back
self
.
assertIsNotNone
(
self
.
portal
.
restrictedTraverse
(
file_path
))
self
.
assertIsNotNone
(
self
.
portal
.
restrictedTraverse
(
file_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