From 6045079fd3e2c9c14af66b5e353fe4359e09fb40 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Thu, 15 Nov 2007 12:32:21 +0000 Subject: [PATCH] If test fail, display verbose message git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17626 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testImmobilisation.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/product/ERP5/tests/testImmobilisation.py b/product/ERP5/tests/testImmobilisation.py index 37c03ecb43..58c03b5011 100644 --- a/product/ERP5/tests/testImmobilisation.py +++ b/product/ERP5/tests/testImmobilisation.py @@ -2934,7 +2934,7 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): def _testAccountingBuild(self, c_transaction_list, e_transaction_list): - #self.assertEquals(len(c_transaction_list),len(e_transaction_list)) + self.assertEquals(len(c_transaction_list), len(e_transaction_list)) e_removed_list = [] for c_transaction in c_transaction_list: #LOG('c_transaction %s :' % c_transaction, 0, @@ -3022,9 +3022,18 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): key_cursor += 1 if not wrong_line: e_found_line = e_line + else: + LOG('c_value e_value', 0, (c_value, e_value)) e_line_cursor += 1 if e_found_line is None: - self.failUnless(e_found_line is not None) + import pprint + self.fail('Calculated Transaction %s not expected:\n\t source=%s\n\tdestination=%s\n\tquantity=%s\n\tquantity_sign=%s\n%s' % ( + c_line.getRelativeUrl(), + c_line.getSource(), + c_line.getDestination(), + c_line.getQuantity(), + c_line.getQuantitySign(), + pprint.pformat(e_line_list))) e_line_list.remove(e_found_line) if len(e_line_list) > 0: self.assertEquals(len(e_line_list),0) -- 2.30.9