From 872359c61c6dede0e7203729a330a67250cc0d1d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 8 Feb 2013 19:34:18 +0530 Subject: [PATCH] pass purchase invoice test cases --- .../purchase_invoice/test_purchase_invoice.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 8ad66fc9ea..0619475bd1 100644 --- a/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -39,7 +39,14 @@ class TestPurchaseInvoice(unittest.TestCase): make_test_records("Purchase Invoice", verbose=0) def test_gl_entries(self): - wrapper = webnotes.model_wrapper(self.get_test_doclist()).insert() + wrapper = webnotes.model_wrapper(self.get_test_doclist()) + + # circumvent the disabled calculation call + obj = webnotes.get_obj(doc=wrapper.doc, doclist=wrapper.doclist) + obj.calculate_taxes_and_totals() + wrapper.set_doclist(obj.doclist) + + wrapper.insert() wrapper.submit() wrapper.load_from_db() dl = wrapper.doclist @@ -61,7 +68,14 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual([d.debit, d.credit], expected_gl_entries.get(d.account)) def test_purchase_invoice_calculation(self): - wrapper = webnotes.model_wrapper(self.get_test_doclist()).insert() + wrapper = webnotes.model_wrapper(self.get_test_doclist()) + + # circumvent the disabled calculation call + obj = webnotes.get_obj(doc=wrapper.doc, doclist=wrapper.doclist) + obj.calculate_taxes_and_totals() + wrapper.set_doclist(obj.doclist) + + wrapper.insert() wrapper.load_from_db() self.assertEqual(wrapper.doclist[0].net_total, 1250)