Commit b3a8ab0e authored by Łukasz Nowak's avatar Łukasz Nowak

- test category_publication_workflow as having specific scripts can lead to...

 - test category_publication_workflow as having specific scripts can lead to non functional system with errors unrelated to DCWorkflow



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29502 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28984cb9
......@@ -1402,8 +1402,39 @@ class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
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
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