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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 27 11:47:48 CET 2008


Author: jerome
Date: Thu Mar 27 11:47:47 2008
New Revision: 20177

URL: http://svn.erp5.org?rev=20177&view=rev
Log:
test template ation using Base_doAction, it's what erp5_xhtml_style usees

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=20177&r1=20176&r2=20177&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Thu Mar 27 11:47:47 2008
@@ -3302,6 +3302,29 @@
 
     self.assertEqual(new_document.getTitle(), 'My Accounting Transaction')
 
+  def test_Base_doAction(self):
+    # test creating a template using Base_doAction script (this is what
+    # erp5_xhtml_style does)
+    self.login('claudie')
+    preference = self.portal.portal_preferences.newContent('Preference')
+    preference.priority = Priority.USER
+    preference.enable()
+
+    get_transaction().commit()
+    self.tic()
+
+    document = self.accounting_module.newContent(
+                              portal_type='Accounting Transaction')
+    document.edit(title='My Accounting Transaction')
+    document.Base_makeTemplateFromDocument(form_id=None)
+    
+    template = preference.objectValues()[0]
+    ret = self.accounting_module.Base_doAction(
+        select_action='template %s' % template.getRelativeUrl(),
+        form_id='', cancel_url='')
+    self.failUnless('Template%20Created' in ret, ret)
+    self.assertEquals(2, len(self.accounting_module.contentValues()))
+
 
 def test_suite():
   suite = unittest.TestSuite()




More information about the Erp5-report mailing list