Commit da7e5489 authored by Jérome Perrin's avatar Jérome Perrin

test we can export a transaction with ODS


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19035 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cb212f66
...@@ -1596,6 +1596,35 @@ class TestClosingPeriod(AccountingTestCase): ...@@ -1596,6 +1596,35 @@ class TestClosingPeriod(AccountingTestCase):
# TODO : test deletion ? # TODO : test deletion ?
class TestAccountingExport(AccountingTestCase):
"""Test accounting export features with erp5_ods_style.
"""
def getBusinessTemplateList(self):
return AccountingTestCase.getBusinessTemplateList(self) + (
'erp5_ods_style', )
def test_export_transaction(self):
# test we can export an accounting transaction as ODS
transaction = self._makeOne(lines=(
dict(source_value=self.account_module.payable,
quantity=200),))
ods_data = transaction.Base_viewAsODS(
form_id='AccountingTransaction_view')
from Products.ERP5OOo.OOoUtils import OOoParser
parser = OOoParser()
parser.openFromString(ods_data)
content_xml = parser.oo_files['content.xml']
# just make sure that we have the correct account name
self.assertEquals(
'40 - Payable',
self.account_module.payable.Account_getFormattedTitle())
# check that this account name can be found in the content
self.assertTrue('40 - Payable' in content_xml)
# check that we don't have unknown categories
self.assertFalse('???' in content_xml)
class TestAccounting(ERP5TypeTestCase): class TestAccounting(ERP5TypeTestCase):
"""The first test for Accounting """The first test for Accounting
""" """
......
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