Commit 7ec96324 authored by Jérome Perrin's avatar Jérome Perrin

test creating a document with a relationfield.

It currently only works for multi relation fields

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40884 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8a279d73
<?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="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>_text</string> </key>
<value> <unicode 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 Multi Relation Field Create</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Multi Relation Field Create</td></tr>\n
</thead>\n
<tbody>\n
<tal:block metal:use-macro="here/RelationFieldZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewRelationField</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>type</td>\n
<td>field_my_bar_category_title_list</td>\n
<td>A new foo<br/>Another new foo</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertText</td>\n
<td>//input[@name=\'field_my_bar_category_title_list\']/../../span</td>\n
<td>No such document was found.</td>\n
</tr>\n
\n
\n
<tr>\n
<td>select</td>\n
<td>subfield_field_my_bar_category_title_list_relation_0</td>\n
<td>label=Add Foo</td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>subfield_field_my_bar_category_title_list_relation_1</td>\n
<td>label=Add Foo</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_my_successor_title</td>\n
<td>field_my_bar_category_title_list</td>\n
<td>A new foo<br/>Another new foo</td>\n
<td></td>\n
</tr>\n
\n
<!-- redisplay with an empty request -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewRelationField</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>field_my_successor_title</td>\n
<td>field_my_bar_category_title_list</td>\n
<td>A new foo<br/>Another new foo</td>\n
<td></td>\n
</tr>\n
\n
</tbody></table>\n
</body>\n
</html>\n
]]></unicode> </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>testMultiRelationFieldCreate</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></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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="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>_text</string> </key>
<value> <unicode 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 Relation Field Create</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Relation Field Create</td></tr>\n
</thead>\n
<tbody>\n
<tal:block metal:use-macro="here/RelationFieldZuite_CommonTemplate/macros/init" />\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/FooModule_createObjects?num:int=1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Created Successfully.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}/foo_module/0/Foo_viewRelationField</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>type</td>\n
<td>field_my_successor_title</td>\n
<td>A new foo</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertText</td>\n
<td>//input[@name=\'field_my_successor_title\']/../../span</td>\n
<td>No such document was found.</td>\n
</tr>\n
\n
\n
<tr>\n
<td>select</td>\n
<td>subfield_field_my_successor_title_relation</td>\n
<td>label=Add Foo</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Save\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_my_successor_title</td>\n
<td>A new foo</td>\n
</tr>\n
\n
<!-- go to the document and verify its title -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@name=\'field_my_successor_title\']/../a</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>field_my_title</td>\n
<td>A new foo</td>\n
</tr>\n
\n
</tbody></table>\n
</body>\n
</html>\n
]]></unicode> </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>testRelationFieldCreate</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></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<item>bar_category</item> <item>bar_category</item>
<item>foo_big_category</item> <item>foo_big_category</item>
<item>foo_category</item> <item>foo_category</item>
<item>successor</item>
</portal_type> </portal_type>
<portal_type id="Foo Bar Module"> <portal_type id="Foo Bar Module">
<item>business_application</item> <item>business_application</item>
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -107,6 +104,7 @@ ...@@ -107,6 +104,7 @@
<string>my_foo_category_title</string> <string>my_foo_category_title</string>
<string>my_bar_category_title_list</string> <string>my_bar_category_title_list</string>
<string>my_bar_category_id_list</string> <string>my_bar_category_id_list</string>
<string>my_successor_title</string>
</list> </list>
</value> </value>
</item> </item>
......
641 642
\ No newline at end of file \ No newline at end of file
...@@ -2,4 +2,5 @@ Foo Bar Module | business_application ...@@ -2,4 +2,5 @@ Foo Bar Module | business_application
Foo Line | foo_category Foo Line | foo_category
Foo | bar_category Foo | bar_category
Foo | foo_big_category Foo | foo_big_category
Foo | foo_category Foo | foo_category
\ No newline at end of file Foo | successor
\ 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