Back to index

plone3  3.1.7
Public Member Functions
plone.app.contentrules.tests.test_action_move.TestMoveAction Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_action_move.TestMoveAction:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_action_move.TestMoveAction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testRegistered
def testInvokeAddView
def testInvokeEditView
def testExecute
def testExecuteWithError
def testExecuteWithoutPermissionsOnTarget
def testExecuteWithNamingConflict
def testExecuteWithSameSourceAndTargetFolder

Detailed Description

Definition at line 25 of file test_action_move.py.


Member Function Documentation

Definition at line 27 of file test_action_move.py.

00027 
00028     def afterSetUp(self):
00029         self.loginAsPortalOwner()
00030         self.portal.invokeFactory('Folder', 'target')
00031         self.login(default_user)
00032         self.folder.invokeFactory('Document', 'd1')

Here is the call graph for this function:

Definition at line 61 of file test_action_move.py.

00061 
00062     def testExecute(self): 
00063         e = MoveAction()
00064         e.target_folder = '/target'
00065         
00066         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00067         self.assertEquals(True, ex())
00068         
00069         self.failIf('d1' in self.folder.objectIds())
00070         self.failUnless('d1' in self.portal.target.objectIds())
        

Here is the call graph for this function:

Definition at line 71 of file test_action_move.py.

00071 
00072     def testExecuteWithError(self): 
00073         e = MoveAction()
00074         e.target_folder = '/dummy'
00075         
00076         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00077         self.assertEquals(False, ex())
00078         
00079         self.failUnless('d1' in self.folder.objectIds())
00080         self.failIf('d1' in self.portal.target.objectIds())
        

Here is the call graph for this function:

Definition at line 93 of file test_action_move.py.

00093 
00094     def testExecuteWithNamingConflict(self):
00095         self.setRoles(('Manager',))
00096         self.portal.target.invokeFactory('Document', 'd1')
00097         self.setRoles(('Member',))
00098         
00099         e = MoveAction()
00100         e.target_folder = '/target'
00101         
00102         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00103         self.assertEquals(True, ex())
00104         
00105         self.failIf('d1' in self.folder.objectIds())
00106         self.failUnless('d1' in self.portal.target.objectIds())
00107         self.failUnless('d1.1' in self.portal.target.objectIds())
        

Here is the call graph for this function:

Definition at line 81 of file test_action_move.py.

00081 
00082     def testExecuteWithoutPermissionsOnTarget(self):
00083         self.setRoles(('Member',))
00084         
00085         e = MoveAction()
00086         e.target_folder = '/target'
00087         
00088         ex = getMultiAdapter((self.folder, e, DummyEvent(self.folder.d1)), IExecutable)
00089         self.assertEquals(True, ex())
00090         
00091         self.failIf('d1' in self.folder.objectIds())
00092         self.failUnless('d1' in self.portal.target.objectIds())
        

Here is the call graph for this function:

Definition at line 108 of file test_action_move.py.

00108 
00109     def testExecuteWithSameSourceAndTargetFolder(self):
00110         self.setRoles(('Manager',))
00111         self.portal.target.invokeFactory('Document', 'd1')
00112         self.setRoles(('Member',))
00113         
00114         e = MoveAction()
00115         e.target_folder = '/target'
00116         
00117         ex = getMultiAdapter((self.portal.target, e, DummyEvent(self.portal.target.d1)), IExecutable)
00118         self.assertEquals(True, ex())
00119         
00120         self.assertEquals(['d1'], list(self.portal.target.objectIds()))
        

Here is the call graph for this function:

Definition at line 40 of file test_action_move.py.

00040 
00041     def testInvokeAddView(self): 
00042         element = getUtility(IRuleAction, name='plone.actions.Move')
00043         storage = getUtility(IRuleStorage)
00044         storage[u'foo'] = Rule()
00045         rule = self.portal.restrictedTraverse('++rule++foo')
00046         
00047         adding = getMultiAdapter((rule, self.portal.REQUEST), name='+action')
00048         addview = getMultiAdapter((adding, self.portal.REQUEST), name=element.addview)
00049         
00050         addview.createAndAdd(data={'target_folder' : '/target',})
00051         
00052         e = rule.actions[0]
00053         self.failUnless(isinstance(e, MoveAction))
00054         self.assertEquals('/target', e.target_folder)
    

Definition at line 55 of file test_action_move.py.

00055 
00056     def testInvokeEditView(self): 
00057         element = getUtility(IRuleAction, name='plone.actions.Move')
00058         e = MoveAction()
00059         editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview)
00060         self.failUnless(isinstance(editview, MoveEditForm))

Definition at line 33 of file test_action_move.py.

00033 
00034     def testRegistered(self): 
00035         element = getUtility(IRuleAction, name='plone.actions.Move')
00036         self.assertEquals('plone.actions.Move', element.addview)
00037         self.assertEquals('edit', element.editview)
00038         self.assertEquals(None, element.for_)
00039         self.assertEquals(IObjectEvent, element.event)
    

The documentation for this class was generated from the following file: