[IMP] Account_voucher : YML test added for reports
authorJay (OpenERP) <jvo@tinyerp.com>
Fri, 17 Sep 2010 11:59:28 +0000 (17:29 +0530)
committerJay (OpenERP) <jvo@tinyerp.com>
Fri, 17 Sep 2010 11:59:28 +0000 (17:29 +0530)
bzr revid: jvo@tinyerp.com-20100917115928-dp4dly4tyu9fjzer

addons/account_voucher/test/account_voucher.yml

index b63bfc9..67d26cb 100644 (file)
   !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)