Commit de47b646 authored by Kevin Deldycke's avatar Kevin Deldycke

Test form_dialog Action List Rendering.

Extract PortalType_addAction delete part to new PortalType_deleteAction script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8817 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ebd9641e
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test form_dialog Action List Rendering</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test form_dialog Action List Rendering</td></tr>\n
</thead><tbody>\n
<!--\n
=== PART 0 ===\n
This part delete the second action if present, in order to reach the initial state\n
of this test. This is required to re-run the test in the same erp5 instance.\n
-->\n
<tr>\n
<td>open</td>\n
<td tal:content="string: ${here/portal_url}/portal_types/Foo%20Module/PortalType_deleteAction?id=search2">Delete second action if exist</td>\n
<td></td>\n
</tr>\n
<!--\n
=== PART 1 ===\n
This part make sure form_dialog Page Template don\'t render <select> widget\n
if only one action exist.\n
-->\n
<tr>\n
<td>open</td>\n
<td tal:content="string: ${here/portal_url}/foo_module/FooModule_viewSearchDialog?dialog_category=object_search">/erp5/foo_module/foo_module/FooModule_viewSearchDialog?dialog_category=object_search</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyElementNotPresent</td>\n
<td>//select[@id="dialog_selector"]</td>\n
<td></td>\n
</tr>\n
<!--\n
=== PART 2 ===\n
This part test that a <select> input is rendered when more than one action exist.\n
-->\n
<tr>\n
<td>open</td>\n
<td tal:content="string: ${here/portal_url}/portal_types/Foo%20Module/PortalType_addAction?id=search2&name=Search2&category=object_search&action=string:%24{portal_url}/FooModule_viewSearchDialog">Create a second dummy search action to test the dynamic creation of select action drop-down list</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td tal:content="string: ${here/portal_url}/foo_module/FooModule_viewSearchDialog?dialog_category=object_search">/erp5/foo_module/foo_module/FooModule_viewSearchDialog?dialog_category=object_search</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//select[@id="dialog_selector"]/option[1]</td>\n
<td>Search</td>\n
</tr>\n
<tr>\n
<td>assertText</td>\n
<td>//select[@id="dialog_selector"]/option[2]</td>\n
<td>Search2</td>\n
</tr>\n
</body>\n
</html>
]]></string> </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>testFormDialogActionListRendering</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -72,21 +72,16 @@ ...@@ -72,21 +72,16 @@
"""\n """\n
assert context.meta_type == \'ERP5 Type Information\'\n assert context.meta_type == \'ERP5 Type Information\'\n
\n \n
existing_actions_indexs = []\n context.PortalType_deleteAction(id=id)\n
for idx, ai in enumerate(context.listActions()):\n
if ai.getId() == id:\n
existing_actions_indexs.append(idx)\n
\n \n
if existing_actions_indexs:\n context.addAction( id = id\n
context.deleteActions(existing_actions_indexs)\n , action = action\n
\n , name = name\n
context.addAction( id=id,\n , condition = condition\n
action=action,\n , permission = permission\n
name=name,\n , category = category\n
condition=condition,\n , icon = icon\n
permission=permission,\n )\n
category=category,\n
icon=icon, )\n
\n \n
return \'Set Successfully.\'\n return \'Set Successfully.\'\n
</string> </value> </string> </value>
...@@ -153,11 +148,6 @@ return \'Set Successfully.\'\n ...@@ -153,11 +148,6 @@ return \'Set Successfully.\'\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>AssertionError</string> <string>AssertionError</string>
<string>existing_actions_indexs</string>
<string>_getiter_</string>
<string>enumerate</string>
<string>idx</string>
<string>ai</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>_body</string> </key>
<value> <string>"""Delete an action on a type informations from types tool.\n
"""\n
assert context.meta_type == \'ERP5 Type Information\'\n
\n
existing_actions_indexs = []\n
for idx, ai in enumerate(context.listActions()):\n
if ai.getId() == id:\n
existing_actions_indexs.append(idx)\n
\n
if existing_actions_indexs:\n
context.deleteActions(existing_actions_indexs)\n
\n
return \'Set Successfully.\'\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>id=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>id</string>
<string>_getattr_</string>
<string>context</string>
<string>AssertionError</string>
<string>existing_actions_indexs</string>
<string>_getiter_</string>
<string>enumerate</string>
<string>idx</string>
<string>ai</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PortalType_deleteAction</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2006-07-26 Kevin
* Test form_dialog Action List Rendering.
* Extract PortalType_addAction delete part to new PortalType_deleteAction script.
2006-07-26 yo 2006-07-26 yo
* Test a validation error with an editable float field in a listbox. * Test a validation error with an editable float field in a listbox.
......
24 33
\ No newline at end of file \ No newline at end of file
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