From 33b330de98f9ac166a110376220058219ab0cb8f Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 11 Feb 2011 22:28:53 +0000
Subject: [PATCH] modify stepCheckPropertySheetExists and
 stepCreateUpdatedPropertySheet for portal_property_sheets.

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

diff --git a/product/ERP5/tests/testBusinessTemplate.py b/product/ERP5/tests/testBusinessTemplate.py
index 52bca06192..55a32b6212 100644
--- a/product/ERP5/tests/testBusinessTemplate.py
+++ b/product/ERP5/tests/testBusinessTemplate.py
@@ -2427,14 +2427,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
     """
     Check presence of Property Sheet
     """
+    ps_title = sequence.get('ps_title', None)
     ps_path = sequence.get('ps_path', None)
     ps_data = sequence.get('ps_data', None)
     self.failUnless(ps_path is not None)
-    self.failUnless(os.path.exists(ps_path))
-    # check data in property sheet
-    f = file(ps_path, 'r')
-    data = f.read()
-    self.assertEqual(data, ps_data)
+    # Property Sheet will not be installed in file sytem
+    self.failIf(os.path.exists(ps_path))
+    # Property Sheet will be installed in ZODB
+    self.failUnless(getattr(self.portal.portal_property_sheets, ps_title, None) is not None)
 
   def stepCheckPropertySheetRemoved(self, sequence=None, sequencer_list=None, **kw):
     """
@@ -2476,14 +2476,14 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
     """
     Check presence of Property Sheet
     """
+    ps_title = sequence.get('ps_title', None)
     ps_path = sequence.get('ps_path', None)
     ps_data = sequence.get('ps_data_u', None)
     self.failUnless(ps_path is not None)
-    self.failUnless(os.path.exists(ps_path))
-    # check data in property sheet
-    f = file(ps_path, 'r')
-    data = f.read()
-    self.assertEqual(data, ps_data)
+    # Property Sheet will not be installed in file sytem
+    self.failIf(os.path.exists(ps_path))
+    # Property Sheet will be installed in ZODB
+    self.failUnless(getattr(self.portal.portal_property_sheets, ps_title, None) is not None)
 
   # Test Constraint
   def stepCreateConstraint(self, sequence=None, sequence_list=None, **kw):
-- 
2.30.9