[Erp5-report] r29502 - /erp5/trunk/products/ERP5/tests/testERP5Web.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 9 10:29:40 CEST 2009
Author: luke
Date: Fri Oct 9 10:29:38 2009
New Revision: 29502
URL: http://svn.erp5.org?rev=29502&view=rev
Log:
- test category_publication_workflow as having specific scripts can lead to non functional system with errors unrelated to DCWorkflow
Modified:
erp5/trunk/products/ERP5/tests/testERP5Web.py
Modified: erp5/trunk/products/ERP5/tests/testERP5Web.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Web.py?rev=29502&r1=29501&r2=29502&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] Fri Oct 9 10:29:38 2009
@@ -1402,8 +1402,39 @@
except Unauthorized:
self.fail("A webmaster should be able to rename a Category.")
+class TestERP5WebCategoryPublicationWorkflow(ERP5TypeTestCase):
+ """Tests possible transitions for category_publication_workflow"""
+ def getBusinessTemplateList(self):
+ return ('erp5_base',
+ 'erp5_web',
+ )
+
+ def afterSetUp(self):
+ base_category = self.getPortal().portal_categories\
+ .newContent(portal_type='Base Category')
+ self.doActionFor = self.getPortal().portal_workflow.doActionFor
+ self.category = base_category.newContent(portal_type='Category')
+ self.assertEqual('embedded', self.category.getValidationState())
+
+ def test_category_embedded_expired(self):
+ self.doActionFor(self.category, 'expire_action')
+ self.assertEqual('expired', self.category.getValidationState())
+
+ def test_category_embedded_protected_expired(self):
+ self.doActionFor(self.category, 'protect_action')
+ self.assertEqual('protected', self.category.getValidationState())
+ self.doActionFor(self.category, 'expire_action')
+ self.assertEqual('expired_protected', self.category.getValidationState())
+
+ def test_category_embedded_published_expired(self):
+ self.doActionFor(self.category, 'publish_action')
+ self.assertEqual('published', self.category.getValidationState())
+ self.doActionFor(self.category, 'expire_action')
+ self.assertEqual('expired_published', self.category.getValidationState())
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Web))
suite.addTest(unittest.makeSuite(TestERP5WebWithSimpleSecurity))
+ suite.addTest(unittest.makeSuite(TestERP5WebCategoryPublicationWorkflow))
return suite
More information about the Erp5-report
mailing list