[Erp5-report] r19035 - /erp5/trunk/products/ERP5/tests/testAccounting.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Feb 4 20:30:17 CET 2008


Author: jerome
Date: Mon Feb  4 20:30:17 2008
New Revision: 19035

URL: http://svn.erp5.org?rev=19035&view=rev
Log:
test we can export a transaction with ODS

Modified:
    erp5/trunk/products/ERP5/tests/testAccounting.py

Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=19035&r1=19034&r2=19035&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Mon Feb  4 20:30:17 2008
@@ -1595,6 +1595,35 @@
     self.assertEquals(1, len(mvt_history_list))
 
   # 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):
   """The first test for Accounting




More information about the Erp5-report mailing list