Commit dc10487c authored by Jérome Perrin's avatar Jérome Perrin

Fix Business Template Update Dialog

3ea8d425 (comment 193284)

See merge request !1837
parents 07496d63 e98c6db2
Pipeline #30999 failed with stage
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testReinstallBusinessTemplate</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Re-install Business Template</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_and_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_and_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/BTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_setUpBusinessTemplateReinstallTest</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Setup OK</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_action</td>
<td>Re-install Business Template</td>
</tr>
<tr>
<tr>
<td>assertText</td>
<td>//button[@name="Base_callDialogMethod:method"]/span</td>
<td>Re-install Business Template</td>
</tr>
<tr>
<td>assertText</td>
<td>css=.listbox-current-page-total-number</td>
<td> 1 records </td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[1]</td>
<td>portal_skins/erp5_test/test_file</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[2]</td>
<td>Skin</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[3]</td>
<td>Modified</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[4]/label</td>
<td>Backup And Upgrade</td>
</tr>
<tr>
<td>assertChecked</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[4]/label/input</td>
<td></td>
</tr>
<!-- preview diff -->
<tr>
<td>clickAndWait</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[1]/a</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>modified !</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test1\n</td>
<td></td>
</tr>
<tr>
<td>goBack</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForText</td>
<td>//button[@name="Base_callDialogMethod:method"]/span</td>
<td>Re-install Business Template</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Status changed.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_test/test_file</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td tal:content="string: ${here/portal_url}/foo_module/BTZuite_reset?end=1"/>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testUpgradeFromRepository</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Upgrade Installed Business Template from Repositories</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title tal:content="template/title_and_id"></title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3" tal:content="template/title_and_id"></td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/BTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_setUpBusinessTemplateUpdateFromRepositoryTest</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>OK</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_viewUpdateRepositoryBusinessTemplateListDialog?dialog_category=object_exchange</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Business templates updated successfully.</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_dialog</td>
<td>Upgrade Business Templates from Repositories</td>
</tr>
<tr>
<td>assertText</td>
<td>//button[@name="Base_callDialogMethod:method"]/span</td>
<td>Upgrade Business Templates from Repositories</td>
</tr>
<tr>
<td>assertText</td>
<td>css=.listbox-current-page-total-number</td>
<td> 1 records </td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[2]</td>
<td>test_core</td>
</tr>
<tr>
<td>click</td>
<td>//tr[@class='listbox-data-line-0 DataA']//input[@type='checkbox']</td>
<td></td>
</tr>
<tr>
<td>assertChecked</td>
<td>field_your_detailed_install</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//*[contains(@class, "listbox")]</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td</td>
<td>portal_skins/erp5_test</td>
</tr>
<tr>
<td>assertChecked</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[5]//input[@type="checkbox"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Business Template test_core installed</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_test/test_file</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td tal:content="string: ${here/portal_url}/foo_module/BTZuite_reset?end=1"/>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
</body>
</html>
\ No newline at end of file
"""Installs test_core and make local change, so that later we can reinstall
and see that our local changes are gone.
"""
portal = context.getPortalObject()
portal.portal_templates.installBusinessTemplateListFromRepository(['test_core'])
bt = portal.portal_templates.getInstalledBusinessTemplate('test_core')
portal.portal_skins.erp5_test.test_file.manage_edit(
title='',
content_type='text/plain',
filedata='modified !'
)
return bt.Base_redirect('view', keep_items={'portal_status_message': 'Setup OK'})
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setUpBusinessTemplateReinstallTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
bt = portal.portal_templates.newContent(
title='test_core',
)
bt.install()
return 'OK'
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setUpBusinessTemplateUpdateFromRepositoryTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -63,6 +63,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
......@@ -80,6 +81,14 @@
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>your_detailed_install</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_detailed_install</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>This field is mandatory.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Show the full list of installed paths, making it possible to choose which paths to install or not</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detailed Installation</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment