[REF] Cleanup and moved test to demo.

bzr revid: jth@openerp.com-20100309141305-dgtazi5rew9h9sgr
This commit is contained in:
Julien Thewys 2010-03-09 15:13:05 +01:00
parent 86a2ba5547
commit 66c8141cc3
2 changed files with 15 additions and 10 deletions

View File

@ -62,6 +62,7 @@
'account_installer.xml',
],
'demo_xml': [
'demo/price_accuracy00.yml',
'account_demo.xml',
'project/project_demo.xml',
'project/analytic_account_demo.xml',

View File

@ -49,7 +49,7 @@
-
# This is not working, find a way to do that in YAML, *qty is not
# interpreted because it's not a node.
And this account entry must have a credit equals to 163.70€ which is
And this account entry must have a credit equals to 163.97€ which is
equal to *qty x *price x (1 + *tax)
-
!assert {model: account.invoice, id: invoice1}:
@ -76,17 +76,21 @@
-
!python {model: account.invoice}: |
self.action_move_create(cr, uid, [ref("invoice2")])
-
!python {model: account.invoice}: |
invoice = self.browse(cr, uid, ref("invoice2"))
log(sum(x.credit for x in invoice.move_id.line_id))
assert (sum(x.credit for x in invoice.move_id.line_id) - 163.968) < 0.000001, "Pas bon !!!"
-
!assert {model: account.invoice, id: invoice2}:
test:
- abs(sum(x.credit for x in move_id.line_id) - 163.968) < 0.000001
-
Then this account entry must have a credit equals to the debit
-
!assert {model: account.invoice, id: invoice2}:
test:
- abs(sum(x.credit - x.debit for x in move_id.line_id)) < 0.000001
-
And this account entry must have a credit equals to 163.968€ which is
equal to *qty x *price x (1 + *tax)
-
!python {model: account.invoice}: |
xid = "invoice2"
invoice = self.browse(cr, uid, ref(xid))
sum_of_credits = sum(x.credit for x in invoice.move_id.line_id)
log("The sum of credits for %s is %f", xid, sum_of_credits)
expected_value = 163.968
assert (sum_of_credits - expected_value) < 0.000001, "Wrong sum of credits: %f <> %f" % (sum_of_credits, expected_value)