[REF] Cleanup and moved test to demo.
bzr revid: jth@openerp.com-20100309141305-dgtazi5rew9h9sgr
This commit is contained in:
parent
86a2ba5547
commit
66c8141cc3
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
|
Loading…
Reference in New Issue