[IMP] report_webkit: add a YAML test file to print the demo report.
authorVo Minh Thu <vmt@openerp.com>
Mon, 25 Mar 2013 10:53:19 +0000 (11:53 +0100)
committerVo Minh Thu <vmt@openerp.com>
Mon, 25 Mar 2013 10:53:19 +0000 (11:53 +0100)
bzr revid: vmt@openerp.com-20130325105319-4hyfk1thimr10o34

addons/report_webkit/__openerp__.py
addons/report_webkit/test/print.yml [new file with mode: 0644]

index d1640ab..b962669 100644 (file)
@@ -92,6 +92,9 @@ TODO:
     'demo': [
         "report/webkit_report_demo.xml",
     ],
+    'test': [
+        "test/print.yml",
+    ],
     'installable': True,
     'auto_install': False,
     'images': ['images/companies_webkit.jpeg','images/header_html.jpeg','images/header_img.jpeg'],
diff --git a/addons/report_webkit/test/print.yml b/addons/report_webkit/test/print.yml
new file mode 100644 (file)
index 0000000..b201efa
--- /dev/null
@@ -0,0 +1,10 @@
+-
+  Print the report_webkit demo report.
+- 
+  !python {model: ir.actions.report.xml}: |
+    import os
+    from openerp import netsvc, tools
+    ids = self.pool['ir.actions.report.xml'].search(cr, uid, [], {})
+    (data, format) = netsvc.LocalService('report.webkit.ir.actions.report.xml').create(cr, uid, ids, {}, {})
+    if tools.config['test_report_directory']:
+        file(os.path.join(tools.config['test_report_directory'], 'report_webkit_demo_report.'+format), 'wb+').write(data)