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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
40964db1
Commit
40964db1
authored
Sep 23, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: move template tool tests from testBusinessTemplate to testTemplateTool
parent
5ee17dd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
78 deletions
+72
-78
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+0
-73
product/ERP5/tests/testTemplateTool.py
product/ERP5/tests/testTemplateTool.py
+72
-5
No files found.
product/ERP5/tests/testBusinessTemplate.py
View file @
40964db1
...
...
@@ -5593,79 +5593,6 @@ class TestBusinessTemplate(BusinessTemplateMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_getInstalledBusinessTemplate_installed
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'erp5_test_bt_%s'
%
self
.
id
())
test_bt
.
install
()
self
.
tic
()
self
.
assertEqual
(
test_bt
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_erp5_core_installed
(
self
):
erp5_core
=
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_core'
)
self
.
assertNotEqual
(
None
,
erp5_core
)
self
.
assertEqual
(
'Business Template'
,
erp5_core
.
getPortalType
())
def
test_getInstalledBusinessTemplate_not_installed
(
self
):
self
.
assertEquals
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'not_installed'
))
def
test_getInstalledBusinessTemplate_provision
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
provision_list
=
[
'erp5_test_bt_%s'
%
self
.
id
()])
test_bt
.
install
()
self
.
tic
()
self
.
assertEqual
(
test_bt
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_replaced
(
self
):
test_bt_v1
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'1'
)
test_bt_v1
.
install
()
self
.
tic
()
test_bt_v2
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'2'
)
test_bt_v2
.
install
()
self
.
assertEqual
(
'replaced'
,
test_bt_v1
.
getInstallationState
())
self
.
tic
()
self
.
assertEqual
(
test_bt_v2
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_uninstalled
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
())
test_bt
.
install
()
test_bt
.
uninstall
()
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_replaced_then_uninstalled
(
self
):
test_bt_v1
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'1'
)
test_bt_v1
.
install
()
self
.
tic
()
test_bt_v2
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'2'
)
test_bt_v2
.
install
()
self
.
assertEqual
(
'replaced'
,
test_bt_v1
.
getInstallationState
())
self
.
tic
()
test_bt_v2
.
uninstall
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_checkDependencies
(
self
):
from
Products.ERP5.Document.BusinessTemplate
import
\
BusinessTemplateMissingDependency
...
...
product/ERP5/tests/testTemplateTool.py
View file @
40964db1
...
...
@@ -282,12 +282,79 @@ class TestTemplateTool(ERP5TypeTestCase):
self
.
assertFalse
(
compareVersionStrings
(
'1.0rc1'
,
'>= 1.0'
))
self
.
assertTrue
(
compareVersionStrings
(
'1.0rc1'
,
'>= 1.0rc1'
))
def
test_getInstalledBusinessTemplate
(
self
):
self
.
assertNotEquals
(
None
,
self
.
getPortal
()
\
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_core'
))
self
.
assertEqual
(
None
,
self
.
getPortal
()
\
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_toto'
))
def
test_getInstalledBusinessTemplate_installed
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'erp5_test_bt_%s'
%
self
.
id
())
test_bt
.
install
()
self
.
tic
()
self
.
assertEqual
(
test_bt
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_erp5_core_installed
(
self
):
erp5_core
=
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_core'
)
self
.
assertNotEqual
(
None
,
erp5_core
)
self
.
assertEqual
(
'Business Template'
,
erp5_core
.
getPortalType
())
def
test_getInstalledBusinessTemplate_not_installed
(
self
):
self
.
assertEquals
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'not_installed'
))
def
test_getInstalledBusinessTemplate_provision
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
provision_list
=
[
'erp5_test_bt_%s'
%
self
.
id
()])
test_bt
.
install
()
self
.
tic
()
self
.
assertEqual
(
test_bt
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'erp5_test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_replaced
(
self
):
test_bt_v1
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'1'
)
test_bt_v1
.
install
()
self
.
tic
()
test_bt_v2
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'2'
)
test_bt_v2
.
install
()
self
.
assertEqual
(
'replaced'
,
test_bt_v1
.
getInstallationState
())
self
.
tic
()
self
.
assertEqual
(
test_bt_v2
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_uninstalled
(
self
):
test_bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
())
test_bt
.
install
()
test_bt
.
uninstall
()
self
.
tic
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_getInstalledBusinessTemplate_replaced_then_uninstalled
(
self
):
test_bt_v1
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'1'
)
test_bt_v1
.
install
()
self
.
tic
()
test_bt_v2
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
'test_bt_%s'
%
self
.
id
(),
version
=
'2'
)
test_bt_v2
.
install
()
self
.
assertEqual
(
'replaced'
,
test_bt_v1
.
getInstallationState
())
self
.
tic
()
test_bt_v2
.
uninstall
()
self
.
assertEqual
(
None
,
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplate
(
'test_bt_%s'
%
self
.
id
()))
def
test_revision
(
self
):
template_tool
=
self
.
portal
.
portal_templates
...
...
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