From e193f220457935ca4806910e08cd56e037136a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Jan 2011 12:04:37 +0100 Subject: [PATCH] Fix scenario test on Decimal MySQL returns a Decimal with fixed context --- tests/scenario_account_stock_anglo_saxon.rst | 55 ++++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/tests/scenario_account_stock_anglo_saxon.rst b/tests/scenario_account_stock_anglo_saxon.rst index c2634c72df..67182290fc 100644 --- a/tests/scenario_account_stock_anglo_saxon.rst +++ b/tests/scenario_account_stock_anglo_saxon.rst @@ -209,11 +209,13 @@ Receive 4 products:: >>> shipment.state u'done' >>> stock_supplier.reload() - >>> (stock_supplier.debit, stock_supplier.credit) - (Decimal('0.00'), Decimal('20.00')) + >>> (stock_supplier.debit, stock_supplier.credit) == \ + ... (Decimal('0.00'), Decimal('20.00')) + True >>> stock.reload() - >>> (stock.debit, stock.credit) - (Decimal('20.00'), Decimal('0.00')) + >>> (stock.debit, stock.credit) == \ + ... (Decimal('20.00'), Decimal('0.00')) + True Open supplier invoice:: @@ -227,14 +229,17 @@ Open supplier invoice:: >>> invoice.state u'open' >>> payable.reload() - >>> (payable.debit, payable.credit) - (Decimal('0.00'), Decimal('24.00')) + >>> (payable.debit, payable.credit) == \ + ... (Decimal('0.00'), Decimal('24.00')) + True >>> expense.reload() - >>> (expense.debit, expense.credit) - (Decimal('24.00'), Decimal('20.00')) + >>> (expense.debit, expense.credit) == \ + ... (Decimal('24.00'), Decimal('20.00')) + True >>> stock_supplier.reload() - >>> (stock_supplier.debit, stock_supplier.credit) - (Decimal('20.00'), Decimal('20.00')) + >>> (stock_supplier.debit, stock_supplier.credit) == \ + ... (Decimal('20.00'), Decimal('20.00')) + True Update cost price of product:: @@ -278,11 +283,13 @@ Send 2 products:: >>> shipment.state u'done' >>> stock_customer.reload() - >>> (stock_customer.debit, stock_customer.credit) - (Decimal('12.00'), Decimal('0.00')) + >>> (stock_customer.debit, stock_customer.credit) == \ + ... (Decimal('12.00'), Decimal('0.00')) + True >>> stock.reload() - >>> (stock.debit, stock.credit) - (Decimal('20.00'), Decimal('12.00')) + >>> (stock.debit, stock.credit) == \ + ... (Decimal('20.00'), Decimal('12.00')) + True Open customer invoice:: @@ -292,14 +299,18 @@ Open customer invoice:: >>> invoice.state u'open' >>> receivable.reload() - >>> (receivable.debit, receivable.credit) - (Decimal('20.00'), Decimal('0.00')) + >>> (receivable.debit, receivable.credit) == \ + ... (Decimal('20.00'), Decimal('0.00')) + True >>> revenue.reload() - >>> (revenue.debit, revenue.credit) - (Decimal('0.00'), Decimal('20.00')) + >>> (revenue.debit, revenue.credit) == \ + ... (Decimal('0.00'), Decimal('20.00')) + True >>> stock_customer.reload() - >>> (stock_customer.debit, stock_customer.credit) - (Decimal('12.00'), Decimal('12.00')) + >>> (stock_customer.debit, stock_customer.credit) == \ + ... (Decimal('12.00'), Decimal('12.00')) + True >>> cogs.reload() - >>> (cogs.debit, cogs.credit) - (Decimal('12.00'), Decimal('0.00')) + >>> (cogs.debit, cogs.credit) == \ + ... (Decimal('12.00'), Decimal('0.00')) + True