Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Products.DCWorkflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Products.DCWorkflow
Commits
83bf6651
Commit
83bf6651
authored
Feb 23, 2011
by
Leonardo Rochael Almeida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forward port r120551: Allow renaming of states, transitions, variables and worklists
parent
4ab5213c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
2 deletions
+36
-2
Products/DCWorkflow/States.py
Products/DCWorkflow/States.py
+1
-0
Products/DCWorkflow/Transitions.py
Products/DCWorkflow/Transitions.py
+1
-0
Products/DCWorkflow/Variables.py
Products/DCWorkflow/Variables.py
+1
-0
Products/DCWorkflow/Worklists.py
Products/DCWorkflow/Worklists.py
+1
-0
Products/DCWorkflow/tests/test_DCWorkflow.py
Products/DCWorkflow/tests/test_DCWorkflow.py
+32
-2
No files found.
Products/DCWorkflow/States.py
View file @
83bf6651
...
...
@@ -265,6 +265,7 @@ class States(ContainerTab):
all_meta_types
=
({
'name'
:
StateDefinition
.
meta_type
,
'action'
:
'addState'
,
'permission'
:
ManagePortal
,
},)
_manage_states
=
DTMLFile
(
'states'
,
_dtmldir
)
...
...
Products/DCWorkflow/Transitions.py
View file @
83bf6651
...
...
@@ -227,6 +227,7 @@ class Transitions (ContainerTab):
all_meta_types
=
({
'name'
:
TransitionDefinition
.
meta_type
,
'action'
:
'addTransition'
,
'permission'
:
ManagePortal
,
},)
_manage_transitions
=
DTMLFile
(
'transitions'
,
_dtmldir
)
...
...
Products/DCWorkflow/Variables.py
View file @
83bf6651
...
...
@@ -115,6 +115,7 @@ class Variables(ContainerTab):
all_meta_types
=
({
'name'
:
VariableDefinition
.
meta_type
,
'action'
:
'addVariable'
,
'permission'
:
ManagePortal
,
},)
_manage_variables
=
DTMLFile
(
'variables'
,
_dtmldir
)
...
...
Products/DCWorkflow/Worklists.py
View file @
83bf6651
...
...
@@ -199,6 +199,7 @@ class Worklists(ContainerTab):
all_meta_types = ({'
name
':WorklistDefinition.meta_type,
'
action
':'
addWorklist
',
'
permission
': ManagePortal,
},)
_manage_worklists = DTMLFile('
worklists
', _dtmldir)
...
...
Products/DCWorkflow/tests/test_DCWorkflow.py
View file @
83bf6651
...
...
@@ -16,28 +16,35 @@
import
unittest
import
Testing
import
transaction
from
zope.component
import
adapter
from
zope.component
import
provideHandler
from
zope.interface.verify
import
verifyClass
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.CMFCore.testing
import
TraversingEventZCMLLayer
from
Products.CMFCore.tests.base.dummy
import
DummyContent
from
Products.CMFCore.tests.base.dummy
import
DummySite
from
Products.CMFCore.tests.base.dummy
import
DummyTool
from
Products.CMFCore.tests.base.security
import
OmnipotentUser
from
Products.CMFCore.tests.base.testcase
import
SecurityTest
from
Products.CMFCore.WorkflowTool
import
WorkflowTool
from
Products.DCWorkflow.interfaces
import
IAfterTransitionEvent
from
Products.DCWorkflow.interfaces
import
IBeforeTransitionEvent
class
DCWorkflowDefinitionTests
(
unittest
.
TestCase
):
class
DCWorkflowDefinitionTests
(
SecurityTest
):
layer
=
TraversingEventZCMLLayer
def
setUp
(
self
):
SecurityTest
.
setUp
(
self
)
self
.
site
=
DummySite
(
'site'
)
self
.
root
.
_setObject
(
'site'
,
self
.
site
)
self
.
site
.
_setObject
(
'portal_types'
,
DummyTool
()
)
self
.
site
.
_setObject
(
'portal_workflow'
,
WorkflowTool
()
)
self
.
_constructDummyWorkflow
()
transaction
.
savepoint
(
optimistic
=
True
)
newSecurityManager
(
None
,
OmnipotentUser
().
__of__
(
self
.
site
))
def
test_interfaces
(
self
):
from
Products.CMFCore.interfaces
import
IWorkflowDefinition
...
...
@@ -70,6 +77,9 @@ class DCWorkflowDefinitionTests(unittest.TestCase):
default_expr
=
"python:state_change.kwargs.get('comment', '')"
,
for_status
=
1
,
update_always
=
1
)
wf
.
worklists
.
addWorklist
(
'published_documents'
)
def
_getDummyWorkflow
(
self
):
wftool
=
self
.
site
.
portal_workflow
return
wftool
.
wf
...
...
@@ -175,6 +185,26 @@ class DCWorkflowDefinitionTests(unittest.TestCase):
# Check with kwargs.
self
.
assert_
(
wf
.
isActionSupported
(
dummy
,
'publish'
,
arg1
=
1
,
arg2
=
2
))
def
test_rename
(
self
):
wftool
=
self
.
site
.
portal_workflow
wf
=
self
.
_getDummyWorkflow
()
wf
.
states
.
manage_renameObject
(
'private'
,
'private_new'
)
self
.
assertNotEquals
(
None
,
wf
.
states
.
_getOb
(
'private_new'
,
None
))
wf
.
transitions
.
manage_renameObject
(
'publish'
,
'publish_new'
)
self
.
assertNotEquals
(
None
,
wf
.
transitions
.
_getOb
(
'publish_new'
,
None
))
wf
.
variables
.
manage_renameObject
(
'comments'
,
'comments_new'
)
self
.
assertNotEquals
(
None
,
wf
.
variables
.
_getOb
(
'comments_new'
,
None
))
wf
.
worklists
.
manage_renameObject
(
'published_documents'
,
'published_documents_new'
)
self
.
assertNotEquals
(
None
,
wf
.
worklists
.
_getOb
(
'published_documents_new'
,
None
))
# XXX more tests...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment