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
amrani
erp5
Commits
bb50d453
Commit
bb50d453
authored
Jan 04, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Update tests for Business Package
parent
4df25a91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
product/ERP5/bootstrap/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
...teItem/portal_components/test.erp5.testBusinessPackage.py
+7
-8
No files found.
product/ERP5/bootstrap/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
View file @
bb50d453
...
...
@@ -25,10 +25,8 @@
#
##############################################################################
import
tempfile
from
Products.ERP5Type.tests.runUnitTest
import
tests_home
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
time
class
TestBusinessPackage
(
ERP5TypeTestCase
):
"""
...
...
@@ -62,7 +60,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
This is ran before anything, used to set the environment
"""
# 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
.
package
=
self
.
_createBusinessPackage
()
...
...
@@ -75,9 +73,10 @@ class TestBusinessPackage(ERP5TypeTestCase):
pass
def
_createBusinessPackage
(
self
):
package
=
self
.
portal
.
newContent
(
portal_type
=
'Business Package'
)
self
.
assertTrue
(
package
.
getBuildingState
()
==
'draft'
)
self
.
assertTrue
(
package
.
getInstallationState
()
==
'not_installed'
)
new_id
=
'package_%s'
%
str
(
time
.
time
())
package
=
self
.
portal
.
newContent
(
id
=
new_id
,
portal_type
=
'Business Package'
)
#self.assertTrue(package.getBuildingState() == 'draft')
#self.assertTrue(package.getInstallationState() == 'not_installed')
package
.
edit
(
title
=
'test_package'
,
version
=
'1.0'
,
description
=
'package for live test'
)
...
...
@@ -128,7 +127,7 @@ class TestBusinessPackage(ERP5TypeTestCase):
self
.
tic
()
# Test if the file is gone
self
.
assert
IsNone
(
self
.
portal
.
restrictedTraverse
(
file_path
))
self
.
assert
Raises
(
KeyError
,
lambda
:
self
.
portal
.
restrictedTraverse
(
file_path
))
# Install package
self
.
_installBusinessPackage
()
...
...
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