From eeb1ce9bb2cb22e099541d43bed8498fbb2e4b23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Tue, 12 Dec 2006 10:10:56 +0000
Subject: [PATCH] check workflows are backup with their subobjects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11678 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testBusinessTemplate.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/product/ERP5/tests/testBusinessTemplate.py b/product/ERP5/tests/testBusinessTemplate.py
index c25eac4066..188e622a3d 100644
--- a/product/ERP5/tests/testBusinessTemplate.py
+++ b/product/ERP5/tests/testBusinessTemplate.py
@@ -890,6 +890,16 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
     workflow = pw._getOb(wf_id, None)
     self.failUnless(workflow is None)
 
+  def stepCheckWorkflowBackup(self, sequence=None, sequence_list=None, **kw):
+    """
+    Check workflow and its subobjects has been well backup in portal trash
+    """
+    wf_id = sequence.get('workflow_id')
+    tt = self.getPortal()['portal_trash']
+    self.assertEqual(len(tt.objectIds()), 1)
+    bin = tt.objectValues()[0]
+    self.assertNotEqual(len(bin.portal_workflow_items[wf_id].objectIds()), 0)
+
   # Actions
   def stepCreateFirstAction(self, sequence=None, sequence_list=None, **kw):
     """
@@ -2965,6 +2975,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
                        CheckInstalledInstallationState \
                        CheckBuiltBuildingState \
                        CheckTrashBin \
+                       CheckWorkflowBackup \
                        CheckPortalTypeExists \
                        CheckModuleExists \
                        CheckSkinFolderExists \
-- 
2.30.9