Commit 812285ee authored by Jérome Perrin's avatar Jérome Perrin

test for printing hierarchical order


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22721 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7be64127
...@@ -2526,6 +2526,46 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase): ...@@ -2526,6 +2526,46 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
if err_list: if err_list:
self.fail(''.join(err_list)) self.fail(''.join(err_list))
def test_Order_viewAsODT_hierarchical(self):
# tests order printout with hierearchical order (with lines inside lines)
resource = self.portal.getDefaultModule(
self.resource_portal_type).newContent(
portal_type=self.resource_portal_type,
title='Resource',)
client = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Client')
vendor = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Vendor')
order = self.portal.getDefaultModule(self.order_portal_type).newContent(
portal_type=self.order_portal_type,
title='Order',
source_value=vendor,
source_section_value=vendor,
destination_value=client,
destination_section_value=client)
line = order.newContent(portal_type=self.order_line_portal_type,
description='Content')
if self.order_line_portal_type not in [x.getId() for x in
line.allowedContentTypes()]:
return # skip this test if hierarchical orders are not available (eg.
# for Purchase Order)
line = line.newContent(portal_type=self.order_line_portal_type,
resource_value=resource,
quantity=10,
price=3)
order.confirm()
get_transaction().commit()
self.tic()
odt = order.Order_viewAsODT()
from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator()
err_list = odf_validator.validate(odt)
if err_list:
self.fail(''.join(err_list))
# TODO: test with cells ?
def test_suite(): def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment