From bfa87093afcc4bf9af8c83e414d1151f02ce3730 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 11 Jan 2007 18:21:45 +0000
Subject: [PATCH] call getattr later, otherwise we get the AttributeError
 before calling assertRaises

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12033 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testBase.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/tests/testBase.py b/product/ERP5/tests/testBase.py
index 5092f08962..dd6cfe94f7 100644
--- a/product/ERP5/tests/testBase.py
+++ b/product/ERP5/tests/testBase.py
@@ -946,7 +946,7 @@ class TestBase(ERP5TypeTestCase):
     # Add a non-existent workflow.
     pw = self.getWorkflowTool()
     dummy_worlflow_id = 'never_existent_workflow'
-    pw.manage_addWorkflow('dc_workflow (Web-configurable workflow)', 
+    pw.manage_addWorkflow('dc_workflow (Web-configurable workflow)',
                           dummy_worlflow_id)
     cbt = pw._chains_by_type
     props = {}
@@ -961,7 +961,8 @@ class TestBase(ERP5TypeTestCase):
     _aq_reset()
 
     try:
-      self.assertRaises(AttributeError, obj.thisMethodShouldNotBePresent)
+      self.assertRaises(AttributeError, getattr, obj,
+                        'thisMethodShouldNotBePresent')
     finally:
       # Make sure that the artificial workflow is not referred to any longer.
       cbt = pw._chains_by_type
-- 
2.30.9