From 1390cc8ae40a6ec962d06cd634055f95a9eaa40b Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 27 Sep 2006 14:22:42 +0000
Subject: [PATCH] Improve testDelete. Check if the object has a delete_action
 transition, this transition is called. Object has to be hidden to the user
 after the transition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10365 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_tests/listbox_zuite/testDelete.xml | 11 ++-
 .../foo_workflow/states/deleted.xml           | 28 ++++++++
 .../foo_workflow/states/draft.xml             |  2 +
 .../foo_workflow/transitions/delete.xml       | 70 +++++++++++++++++++
 .../transitions/delete_action.xml             | 70 +++++++++++++++++++
 bt5/erp5_ui_test/bt/revision                  |  2 +-
 .../template_portal_type_base_category_list   |  1 +
 7 files changed, 182 insertions(+), 2 deletions(-)
 create mode 100644 bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/deleted.xml
 create mode 100644 bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete.xml
 create mode 100644 bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete_action.xml

diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testDelete.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testDelete.xml
index 6eac9bbf9c..20333ce7dd 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testDelete.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/listbox_zuite/testDelete.xml
@@ -135,7 +135,16 @@
 \t<td>id=listbox_data_line_3</td>\n
 \t<td></td>\n
 </tr>\n
-\n
+<tr>\n
+\t<td>open</td>\n
+\t<td>${base_url}/foo_module/0/getSimulationState</td>\n
+\t<td></td>\n
+</tr>\n
+<tr>\n
+\t<td>assertTextPresent</td>\n
+\t<td>deleted</td>\n
+\t<td></td>\n
+</tr>\n
 </tbody></table>\n
 </body>\n
 </html>\n
diff --git a/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/deleted.xml b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/deleted.xml
new file mode 100644
index 0000000000..ec3e3921c2
--- /dev/null
+++ b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/deleted.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.States</string>
+          <string>StateDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>deleted</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml
index e910deba0e..bffb0ac2ed 100644
--- a/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml
+++ b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/states/draft.xml
@@ -34,6 +34,8 @@
             <key> <string>transitions</string> </key>
             <value>
               <tuple>
+                <string>delete</string>
+                <string>delete_action</string>
                 <string>dummy_action</string>
                 <string>dummy_failing_action</string>
               </tuple>
diff --git a/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete.xml b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete.xml
new file mode 100644
index 0000000000..2659ed2cfa
--- /dev/null
+++ b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.Transitions</string>
+          <string>TransitionDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>delete</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string>deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete_action.xml b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete_action.xml
new file mode 100644
index 0000000000..ef98f2d5de
--- /dev/null
+++ b/bt5/erp5_ui_test/WorkflowTemplateItem/portal_workflow/foo_workflow/transitions/delete_action.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.DCWorkflow.Transitions</string>
+          <string>TransitionDefinition</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string>delete</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>delete_action</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision
index 7730ef7f3e..69226f7293 100644
--- a/bt5/erp5_ui_test/bt/revision
+++ b/bt5/erp5_ui_test/bt/revision
@@ -1 +1 @@
-89
\ No newline at end of file
+92
\ No newline at end of file
diff --git a/bt5/erp5_ui_test/bt/template_portal_type_base_category_list b/bt5/erp5_ui_test/bt/template_portal_type_base_category_list
index 17925fa98f..89ebfc72ea 100644
--- a/bt5/erp5_ui_test/bt/template_portal_type_base_category_list
+++ b/bt5/erp5_ui_test/bt/template_portal_type_base_category_list
@@ -1 +1,2 @@
+Foo | bar_category
 Foo | foo_category
\ No newline at end of file
-- 
2.30.9