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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
1bd51006
Commit
1bd51006
authored
Nov 28, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplate: src argument for ERP5 SQL Method(s) should be exported in separated 'sql' file.
Also, add tests for them
parent
f7e0ac52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-0
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
+48
-0
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
1bd51006
...
...
@@ -144,6 +144,7 @@ SEPARATELY_EXPORTED_PROPERTY_DICT = {
"PythonScript"
:
(
"py"
,
0
,
"_body"
),
"Spreadsheet"
:
(
None
,
0
,
"data"
),
"SQL"
:
(
"sql"
,
0
,
"src"
),
"SQL Method"
:
(
"sql"
,
0
,
"src"
),
"Test Component"
:
(
"py"
,
0
,
"text_content"
),
"Test Page"
:
(
None
,
0
,
"text_content"
),
"Web Page"
:
(
None
,
0
,
"text_content"
),
...
...
product/ERP5/tests/testBusinessTemplateTwoFileExport.py
View file @
1bd51006
...
...
@@ -573,6 +573,54 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
for
property_id
,
property_value
in
method_document_kw
.
iteritems
():
self
.
assertEqual
(
getattr
(
method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForERP5SQLMethodInCatalog
(
self
):
"""Test Business Template Import And Export With ERP5 SQL Method In Catalog"""
catalog_tool
=
self
.
getCatalogTool
()
catalog
=
catalog_tool
.
getSQLCatalog
()
catalog_id
=
catalog
.
id
self
.
assertTrue
(
catalog
is
not
None
)
method_id
=
"z_another_dummy_method"
if
method_id
in
catalog
.
objectIds
():
catalog
.
manage_delObjects
([
method_id
])
method_document_kw
=
{
'id'
:
method_id
,
'title'
:
'dummy_method_title'
,
'connection_id'
:
'erp5_sql_connection'
,
'arguments_src'
:
'args'
,
'src'
:
'dummy_method_template'
}
addSQLMethod
=
catalog
.
newContent
addSQLMethod
(
portal_type
=
'SQL Method'
,
id
=
method_id
,
title
=
'dummy_method_title'
,
connection_id
=
'erp5_sql_connection'
,
arguments_src
=
'args'
,
src
=
'dummy_method_template'
,
)
zsql_method
=
catalog
.
_getOb
(
method_id
,
None
)
self
.
assertTrue
(
zsql_method
is
not
None
)
self
.
template
.
edit
(
template_catalog_method_id_list
=
[
catalog_id
+
'/'
+
method_id
])
self
.
_buildAndExportBusinessTemplate
()
method_document_path
=
os
.
path
.
join
(
self
.
export_dir
,
'CatalogMethodTemplateItem'
,
'portal_catalog'
,
catalog_id
,
method_id
)
import_template
=
self
.
_exportAndReImport
(
method_document_path
,
".sql"
,
'dummy_method_template'
,
[
'src'
])
catalog
.
manage_delObjects
([
method_id
])
import_template
.
install
()
method_page
=
catalog
[
method_id
]
for
property_id
,
property_value
in
method_document_kw
.
iteritems
():
self
.
assertEqual
(
getattr
(
method_page
,
property_id
),
property_value
)
def
test_twoFileImportExportForCatalogMethodInPortalSkins
(
self
):
"""Test Business Template Import And Export With Catalog Method In Portal Skins"""
...
...
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