Permalink
Browse files

Allow polls to be reopened after they have been closed. closes #53

  • Loading branch information...
1 parent 4439083 commit 68c3065208048bc0195dab017bcb5311bbc24ec4 @frapell frapell committed Aug 17, 2012
View
@@ -6,7 +6,9 @@ Because you have to know where your towel is.
1.2 (unreleased)
^^^^^^^^^^^^^^^^
-- Nothing changed yet.
+- Added the 'open' transition to the 'closed' state, that way,
+ polls can be re-opened after they were closed
+ [frapell]
1.1 (2012-08-14)
@@ -15,6 +15,7 @@
<permission>collective.polls: Vote</permission>
<state state_id="closed" title="Closed" i18n:attributes="title">
+ <exit-transition transition_id="open"/>
<permission-map name="Access contents information" acquired="True">
</permission-map>
<permission-map name="Modify portal content" acquired="False">
@@ -190,6 +190,21 @@ def test_workflow_direct(self):
review_state = self.wt.getInfoFor(self.obj, 'review_state')
self.assertEqual(review_state, 'closed')
+ def test_polls_can_be_reopened(self):
+ setRoles(self.portal, TEST_USER_ID, ['Manager'])
+ self.wt.doActionFor(self.obj, 'open')
+ review_state = self.wt.getInfoFor(self.obj, 'review_state')
+ self.assertEqual(review_state, 'open')
+ self.wt.doActionFor(self.obj, 'close')
+ review_state = self.wt.getInfoFor(self.obj, 'review_state')
+ self.assertEqual(review_state, 'closed')
+ self.wt.doActionFor(self.obj, 'open')
+ review_state = self.wt.getInfoFor(self.obj, 'review_state')
+ self.assertEqual(review_state, 'open')
+ self.wt.doActionFor(self.obj, 'close')
+ review_state = self.wt.getInfoFor(self.obj, 'review_state')
+ self.assertEqual(review_state, 'closed')
+
def test_workflow_transitions_not_allowed(self):
setRoles(self.portal, TEST_USER_ID, ['Manager'])
# We cannot close a private poll
@@ -235,7 +250,7 @@ def test_workflow_transitions_not_allowed(self):
review_state = self.wt.getInfoFor(self.obj, 'review_state')
self.assertEqual(review_state, 'closed')
- #Finally, we cannot do anything else from a closed poll
+ #Finally, we cannot do anything else from a closed poll, except reopen it
self.assertRaises(WorkflowException,
self.wt.doActionFor,
self.obj, 'retract')
@@ -244,10 +259,6 @@ def test_workflow_transitions_not_allowed(self):
self.wt.doActionFor,
self.obj, 'submit')
- self.assertRaises(WorkflowException,
- self.wt.doActionFor,
- self.obj, 'open')
-
def test_workflow_permissions(self):
setRoles(self.portal, TEST_USER_ID, ['Member'])
# guard-permission: Review portal content

2 comments on commit 68c3065

Owner

hvelarde replied Aug 17, 2012

@frapell could you please update the documentation also?

Owner

hvelarde replied Aug 17, 2012

I think you forgot the upgrade step...

Please sign in to comment.