def test_editor_can_unlock(self):
     # Default Plone behavior: Editor can unlock other's people lock
     portal = self.layer['portal']
     login(portal, 'user1')
     lockable = IRefreshableLockable(portal.document)
     self.assertTrue(lockable._user_can_unlock())
     self.assertTrue(lockable.stealable())
 def test_can_remove_my_lock(self):
     portal = self.layer['portal']
     login(portal, 'user1')
     lockable = IRefreshableLockable(portal.document)
     lockable.lock()
     setRoles(portal, 'user1', ['Member', ])
     lockable = IRefreshableLockable(portal.document)
     # Not editor anymore...
     self.assertFalse(lockable._user_can_unlock())
     # ...but can unlock
     self.assertTrue(lockable._lock_is_mine())
     self.assertTrue(lockable.stealable())