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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
8d7c7dcc
Commit
8d7c7dcc
authored
Oct 31, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTemplateTool: test the migration of actions in erp5_csv_style when updating the bt
cf commit
550e81b0
parent
cb23632c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
product/ERP5/tests/testTemplateTool.py
product/ERP5/tests/testTemplateTool.py
+34
-4
No files found.
product/ERP5/tests/testTemplateTool.py
View file @
8d7c7dcc
...
...
@@ -34,6 +34,7 @@ import random
import
tempfile
from
xml.dom.minidom
import
getDOMImplementation
from
App.config
import
getConfiguration
from
Products.CMFCore.ActionsTool
import
ActionsTool
from
Products.ERP5.Document.BusinessTemplate
import
\
BusinessTemplateMissingDependency
...
...
@@ -52,7 +53,6 @@ class TestTemplateTool(ERP5TypeTestCase):
'erp5_full_text_mroonga_catalog'
,
'erp5_base'
,
'erp5_stock_cache'
,
'erp5_csv_style'
,
'erp5_crm'
,
'erp5_forge'
)
...
...
@@ -149,13 +149,43 @@ class TestTemplateTool(ERP5TypeTestCase):
the new bt5 is not installed, only imported.
"""
self
.
_svn_setup_ssl
()
global
PropertiesTool
class
PropertiesTool
(
ActionsTool
):
id
=
'portal_properties'
cls
=
PropertiesTool
# Assign a fake properties tool to the portal
tool
=
PropertiesTool
()
self
.
portal
.
_setObject
(
tool
.
id
,
tool
,
set_owner
=
False
,
suppress_events
=
True
)
del
tool
self
.
commit
()
template_tool
=
self
.
portal
.
portal_templates
url
=
'https://svn.erp5.org/repos/public/erp5/trunk/bt5/erp5_csv_style'
template_tool
.
updateBusinessTemplateFromUrl
(
url
)
old_bt
=
template_tool
.
getInstalledBusinessTemplate
(
'erp5_csv_style'
)
# fake different revision
old_bt
.
setRevision
(
''
)
url
=
'https://svn.erp5.org/repos/public/erp5/trunk/bt5/erp5_csv_style'
template_tool
.
updateBusinessTemplateFromUrl
(
url
)
new_bt
=
template_tool
.
getInstalledBusinessTemplate
(
'erp5_csv_style'
)
# Break the properties tool
self
.
assertIs
(
self
.
portal
.
portal_properties
.
__class__
,
cls
)
self
.
commit
()
self
.
portal
.
_p_jar
.
cacheMinimize
()
del
PropertiesTool
self
.
assertIsNot
(
self
.
portal
.
portal_properties
.
__class__
,
cls
)
# Remove portal.portal_properties
from
Products.ERP5Type.dynamic.portal_type_class
import
\
_bootstrapped
,
synchronizeDynamicModules
_bootstrapped
.
remove
(
self
.
portal
.
id
)
synchronizeDynamicModules
(
self
.
portal
,
force
=
True
)
# The bt from this repo
url
=
self
.
_getBTPathAndIdList
((
'erp5_csv_style'
,))[
0
][
0
]
new_bt
=
template_tool
.
updateBusinessTemplateFromUrl
(
url
)
self
.
assertNotEquals
(
old_bt
,
new_bt
)
self
.
assertEqual
(
'erp5_csv_style'
,
new_bt
.
getTitle
())
...
...
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