From 022cbe0ae72172e8ed65212c69b525e4c2f86c1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 2 Jan 2007 23:03:02 +0000
Subject: [PATCH] added tests for a ParallelListField on Account_view that
 allow setting multiple GAP categories for the same account.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11836 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_categories/gap/another_country.xml | 118 ++++++++++++
 .../gap/another_country/another_standards.xml | 118 ++++++++++++
 .../another_country/another_standards/1.xml   | 106 +++++++++++
 ...t_account_gap_parallel_list_field.html.xml | 172 ++++++++++++++++++
 .../AccountingZuite_reset.xml                 |   8 +
 bt5/erp5_accounting_ui_test/bt/revision       |   2 +-
 .../bt/template_path_list                     |   2 +
 7 files changed, 525 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country.xml
 create mode 100644 bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards.xml
 create mode 100644 bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards/1.xml
 create mode 100644 bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_accounts/test_account_gap_parallel_list_field.html.xml

diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country.xml b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country.xml
new file mode 100644
index 0000000000..2d01eb385a
--- /dev/null
+++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.Document.Category</string>
+          <string>Category</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>gap/another_country</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>another_country</string> </value>
+        </item>
+        <item>
+            <key> <string>last_id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Another Country</string> </value>
+        </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.Length</string>
+          <string>Length</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards.xml b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards.xml
new file mode 100644
index 0000000000..3435d3d217
--- /dev/null
+++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.Document.Category</string>
+          <string>Category</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>gap/another_country/another_standards</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>another_standards</string> </value>
+        </item>
+        <item>
+            <key> <string>last_id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Another Standards</string> </value>
+        </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.Length</string>
+          <string>Length</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards/1.xml b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards/1.xml
new file mode 100644
index 0000000000..5a33788c14
--- /dev/null
+++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/gap/another_country/another_standards/1.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ERP5Type.Document.Category</string>
+          <string>Category</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Dummy Account</string> </value>
+        </item>
+        <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.Length</string>
+          <string>Length</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>BTrees.OOBTree</string>
+          <string>OOBTree</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_accounts/test_account_gap_parallel_list_field.html.xml b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_accounts/test_account_gap_parallel_list_field.html.xml
new file mode 100644
index 0000000000..22bc2066b3
--- /dev/null
+++ b/bt5/erp5_accounting_ui_test/PathTemplateItem/portal_tests/accounting_zuite/test_accounts/test_account_gap_parallel_list_field.html.xml
@@ -0,0 +1,172 @@
+<?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>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<html>\n
+<head><title>Test for Account GAP Parallel listfield</title></head>\n
+<body>\n
+<table cellpadding="1" cellspacing="1" border="1">\n
+<thead>\n
+<tr><td rowspan="1" colspan="4">\n
+Test Account GAP Parallel listfield.\n
+</td></tr>\n
+</thead><tbody tal:define="init_method string:AccountingZuite_createAccountingTransactionList?add_draft_transactions:int=0">\n
+\n
+<!-- Setup {{{ -->\n
+<tal:block metal:use-macro="here/AccountingZuite_CommonTemplate/macros/init"/>\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_module</td>\n
+  <td>Accounts</td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Folder_show:method</td>\n
+  <td></td>\n
+</tr>\n
+<!-- }}} -->\n
+\n
+<!-- {{{ Add an account -->\n
+<tr>\n
+  <td>selectAndWait</td>\n
+  <td>select_action</td>\n
+  <td>Add Account</td>\n
+</tr>\n
+<tr>\n
+  <td>assertPortalStatusMessage</td>\n
+  <td>Object Created.</td>\n
+  <td></td>\n
+</tr>\n
+<!-- }}} -->\n
+\n
+\n
+<tr>\n
+  <td>type</td>\n
+  <td>field_my_title</td>\n
+  <td>Dummy Account for UI Test</td>\n
+</tr>\n
+<tr>\n
+  <td>select</td>\n
+  <td>field_my_account_type</td>\n
+  <td>label=Asset</td>\n
+</tr>\n
+<tr>\n
+  <td>verifyTextPresent</td>\n
+  <td>GAP - Another Standards</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>select</td>\n
+  <td>subfield_field_my_gap_list_my_country/my_accounting_standards</td>\n
+  <td>label=1 - Equity Accounts</td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertValue</td>\n
+  <td>subfield_field_my_gap_list_my_country/my_accounting_standards</td>\n
+  <td>my_country/my_accounting_standards/1</td>\n
+</tr>\n
+<tr>\n
+  <td>assertValue</td>\n
+  <td>subfield_field_my_gap_list_another_country/another_standards</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>select</td>\n
+  <td>subfield_field_my_gap_list_another_country/another_standards</td>\n
+  <td>label=1 - Dummy Account</td>\n
+</tr>\n
+<tr>\n
+  <td>clickAndWait</td>\n
+  <td>Base_edit:method</td>\n
+  <td></td>\n
+</tr>\n
+<tr>\n
+  <td>assertValue</td>\n
+  <td>subfield_field_my_gap_list_my_country/my_accounting_standards</td>\n
+  <td>my_country/my_accounting_standards/1</td>\n
+</tr>\n
+<tr>\n
+  <td>assertValue</td>\n
+  <td>subfield_field_my_gap_list_another_country/another_standards</td>\n
+  <td>another_country/another_standards/1</td>\n
+</tr>\n
+\n
+</tbody></table>\n
+</body>\n
+</html> <!-- vim: syntax=html foldmethod=marker\n
+-->\n
+
+
+]]></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>test_account_gap_parallel_list_field.html</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_reset.xml b/bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_reset.xml
index 0c9ca7fd16..9bb4b373b8 100644
--- a/bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_reset.xml
+++ b/bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_reset.xml
@@ -98,6 +98,13 @@ for form in context.getPortalObject().portal_skins\\\n
 stool.setSelectionFor(\'person_selection\', None)\n
 stool.setSelectionFor(\'organisation_selection\', None)\n
 \n
+# delete the "dummy account" we create in test_account_gap_parallel_list_field\n
+dummy_account_list = portal.account_module.searchFolder(\n
+                                        title=\'Dummy Account for UI Test\')\n
+if dummy_account_list:\n
+  portal.account_module.manage_delObjects([dummy_account_list[0].getId()])\n
+\n
+\n
 return "Reset Successfully."\n
 </string> </value>
         </item>
@@ -160,6 +167,7 @@ return "Reset Successfully."\n
                             <string>getattr</string>
                             <string>None</string>
                             <string>listbox</string>
+                            <string>dummy_account_list</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_accounting_ui_test/bt/revision b/bt5/erp5_accounting_ui_test/bt/revision
index 1758dddcce..dc7b54ad01 100644
--- a/bt5/erp5_accounting_ui_test/bt/revision
+++ b/bt5/erp5_accounting_ui_test/bt/revision
@@ -1 +1 @@
-32
\ No newline at end of file
+33
\ No newline at end of file
diff --git a/bt5/erp5_accounting_ui_test/bt/template_path_list b/bt5/erp5_accounting_ui_test/bt/template_path_list
index f43010b481..c8cdb12493 100644
--- a/bt5/erp5_accounting_ui_test/bt/template_path_list
+++ b/bt5/erp5_accounting_ui_test/bt/template_path_list
@@ -21,6 +21,8 @@ organisation_module/supplier
 organisation_module/supplier/**
 person_module/john_smith
 person_module/john_smith/**
+portal_categories/gap/another_country
+portal_categories/gap/another_country/**
 portal_categories/gap/my_country
 portal_categories/gap/my_country/**
 portal_categories/group/client
-- 
2.30.9