From bcbdcde958f0c515460d7cfbb5e59d0279f277d6 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Fri, 17 Sep 2010 17:29:28 +0530 Subject: [PATCH] [IMP] Account_voucher : YML test added for reports bzr revid: jvo@tinyerp.com-20100917115928-dp4dly4tyu9fjzer --- .../account_voucher/test/account_voucher.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml index b63bfc9d129..67d26cbdbb1 100644 --- a/addons/account_voucher/test/account_voucher.yml +++ b/addons/account_voucher/test/account_voucher.yml @@ -95,3 +95,21 @@ !python {model: account.voucher}: | acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0")) assert(acc_id.move_id) + +- + In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report +- + !python {model: account.voucher}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a account_voucher, we will print account voucher Report +- + !python {model: account.voucher}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data)