From 5ef71b8b2ed318df0595cbf305c355fb159e4541 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 3 Aug 2006 08:23:34 +0000
Subject: [PATCH] use self.assertRaises

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9012 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testAmount.py | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/product/ERP5/tests/testAmount.py b/product/ERP5/tests/testAmount.py
index 7bda251939..3b372b160d 100644
--- a/product/ERP5/tests/testAmount.py
+++ b/product/ERP5/tests/testAmount.py
@@ -145,12 +145,8 @@ class TestAmount(ERP5TypeTestCase):
       Test the method GetVariationPropertyDict.
     """
     amount = sequence.get('amount')
-    try:
-      amount.setVariationPropertyDict(self.variation_property_dict)
-    except KeyError:
-      return
-    else:
-      raise KeyError
+    self.assertRaises(KeyError, amount.setVariationPropertyDict,
+                      self.variation_property_dict)
 
   def stepSetVariationPropertyDict(self, sequence=None, 
                                         sequence_list=None, **kw):
@@ -181,12 +177,8 @@ class TestAmount(ERP5TypeTestCase):
       Test the method GetVariationPropertyDict.
     """
     amount = sequence.get('amount')
-    try:
-      amount.setVariationPropertyDict(self.failed_variation_property_dict)
-    except KeyError:
-      return
-    else:
-      raise KeyError
+    self.assertRaises(KeyError, amount.setVariationPropertyDict,
+                      self.failed_variation_property_dict)
 
   def stepCheckEdit(self, sequence=None, sequence_list=None, **kw):
     """
-- 
2.30.9