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
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
03afb0a2
Commit
03afb0a2
authored
Apr 13, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BT: add missing test for template_keep_path_list
parent
a3fe173e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+47
-0
No files found.
product/ERP5/tests/testBusinessTemplate.py
View file @
03afb0a2
...
...
@@ -6815,6 +6815,53 @@ class TestBusinessTemplate(BusinessTemplateMixin):
self
.
portal
.
manage_delObjects
([
'geek_module'
])
self
.
tic
()
def
test_update_business_template_with_template_keep_path_list
(
self
):
"""Tests for `template_keep_path_list` feature
"""
# Simulate the case where we have an installed business template providing
# the path test_document
new_object
=
self
.
portal
.
newContent
(
portal_type
=
'File'
,
id
=
'test_document'
)
bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
self
.
id
(),
template_path_list
=
(
'test_document'
,),)
self
.
tic
()
bt
.
build
()
self
.
tic
()
export_dir
=
tempfile
.
mkdtemp
()
try
:
bt
.
export
(
path
=
export_dir
,
local
=
True
)
self
.
tic
()
new_bt
=
self
.
portal
.
portal_templates
.
download
(
url
=
'file://%s'
%
export_dir
)
finally
:
shutil
.
rmtree
(
export_dir
)
new_bt
.
install
()
# In a new version of the business template, this path is no longer included
# but we have configured this path as *keep_path_list*
# build and reimport this business template
bt
=
self
.
portal
.
portal_templates
.
newContent
(
portal_type
=
'Business Template'
,
title
=
self
.
id
(),
template_keep_path_list
=
(
'test_document'
,),)
self
.
tic
()
bt
.
build
()
self
.
tic
()
export_dir
=
tempfile
.
mkdtemp
()
try
:
bt
.
export
(
path
=
export_dir
,
local
=
True
)
self
.
tic
()
new_bt
=
self
.
portal
.
portal_templates
.
download
(
url
=
'file://%s'
%
export_dir
)
finally
:
shutil
.
rmtree
(
export_dir
)
self
.
assertEqual
(
{
'test_document'
:
(
'Removed but should be kept'
,
'Path'
)},
new_bt
.
preinstall
())
def
test_BusinessTemplateWithTest
(
self
):
sequence_list
=
SequenceList
()
sequence_string
=
'
\
...
...
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