[CMF-checkins] CVS: CMF/CMFSetup/tests - test_workflow.py:1.11
Tres Seaver
tseaver at zope.com
Tue Jun 8 21:23:14 EDT 2004
Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv1326/tests
Modified Files:
test_workflow.py
Log Message:
- workflow.py:
o Add parsing for top-level permission nodes.
- xml/wtcWorkflowExport.xml:
o Modify guard roles / permissions / groups to avoid ambiguity.
=== CMF/CMFSetup/tests/test_workflow.py 1.10 => 1.11 ===
--- CMF/CMFSetup/tests/test_workflow.py:1.10 Tue Jun 8 21:09:15 2004
+++ CMF/CMFSetup/tests/test_workflow.py Tue Jun 8 21:22:43 2004
@@ -1005,6 +1005,40 @@
, expected[ 8 ] )
self.assertEqual( guard.get( 'expression', '' ), expected[ 9 ] )
+ def test_parseWorkflowXML_normal_permissions( self ):
+
+ from Products.CMFSetup.workflow import TRIGGER_TYPES
+
+ WF_ID = 'normal'
+ WF_TITLE = 'Normal DCWorkflow'
+ WF_INITIAL_STATE = 'closed'
+
+ site = self._initSite()
+
+ configurator = self._makeOne( site ).__of__( site )
+
+ ( workflow_id
+ , title
+ , state_variable
+ , initial_state
+ , states
+ , transitions
+ , variables
+ , worklists
+ , permissions
+ , scripts
+ ) = configurator.parseWorkflowXML( _NORMAL_WORKFLOW_EXPORT
+ % ( WF_ID
+ , WF_TITLE
+ , WF_INITIAL_STATE
+ ) )
+
+ self.assertEqual( len( permissions ), len( _WF_PERMISSIONS ) )
+
+ for permission in permissions:
+
+ self.failUnless( permission in _WF_PERMISSIONS )
+
_WF_PERMISSIONS = \
( 'Open content for modifications'
@@ -1299,8 +1333,8 @@
<value>n/a</value>
</default>
<guard>
- <role>Hangman</role>
- <role>Sherrif</role>
+ <guard-role>Hangman</guard-role>
+ <guard-role>Sherrif</guard-role>
</guard>
</variable>
<variable
@@ -1313,8 +1347,8 @@
<expression>nothing</expression>
</default>
<guard>
- <permission>Query history</permission>
- <permission>Open content for modifications</permission>
+ <guard-permission>Query history</guard-permission>
+ <guard-permission>Open content for modifications</guard-permission>
</guard>
</variable>
<variable
@@ -1327,8 +1361,8 @@
<expression>python:None</expression>
</default>
<guard>
- <permission>Query history</permission>
- <permission>Open content for modifications</permission>
+ <guard-permission>Query history</guard-permission>
+ <guard-permission>Open content for modifications</guard-permission>
</guard>
</variable>
<worklist
@@ -1339,7 +1373,7 @@
category="workflow"
url="string:${portal_url}/expired_items">Expired items</action>
<guard>
- <permission>Restore expired content</permission>
+ <guard-permission>Restore expired content</guard-permission>
</guard>
<match name="state" values="open; closed"/>
</worklist>
@@ -1351,7 +1385,7 @@
category="workflow"
url="string:${portal_url}/expired_items">Expired items</action>
<guard>
- <permission>Restore expired content</permission>
+ <guard-permission>Restore expired content</guard-permission>
</guard>
<match name="state" values="expired"/>
</worklist>
@@ -1432,8 +1466,8 @@
category="workflow"
url="string:${object_url}/close_for_modifications">Close</action>
<guard>
- <role>Owner</role>
- <role>Manager</role>
+ <guard-role>Owner</guard-role>
+ <guard-role>Manager</guard-role>
</guard>
</transition>
<transition
@@ -1445,7 +1479,7 @@
after_script="">
Retire objects whose expiration is past.
<guard>
- <expression>python: object.expiration() <= object.ZopeTime()</expression>
+ <guard-expression>python: object.expiration() <= object.ZopeTime()</guard-expression>
</guard>
<assignment
name="when_expired">object/ZopeTime</assignment>
@@ -1462,7 +1496,7 @@
category="workflow"
url="string:${object_url}/open_for_modifications">Open</action>
<guard>
- <permission>Open content for modifications</permission>
+ <guard-permission>Open content for modifications</guard-permission>
</guard>
<assignment name="when_opened">object/ZopeTime</assignment>
</transition>
@@ -1478,7 +1512,7 @@
category="workflow"
url="string:${object_url}/kill_object">Kill</action>
<guard>
- <group>Content_assassins</group>
+ <guard-group>Content_assassins</guard-group>
</guard>
<assignment
name="killed_by">string:${user/getId}</assignment>
More information about the CMF-checkins
mailing list