Did I find the right examples for you? yes no

All Samples(177)  |  Call(177)  |  Derive(0)  |  Import(0)

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testCatalogTool.py   Products.CMFPlone(Download)
    def testCanPasteCatalog(self):
        # Should be able to copy/paste a portal_catalog. Triggers
        # manage_afterAdd of portal_catalog thereby exposing another bug :-/
        self.setRoles(['Manager'])
        cb = self.portal.manage_copyObjects(['portal_catalog'])
    def testPastingCatalogPreservesTextIndexes(self):
        # Pasting the catalog should not cause indexes to be removed.
        self.setRoles(['Manager'])
        cb = self.portal.manage_copyObjects(['portal_catalog'])
        self.folder.manage_pasteObjects(cb)
    def testPublishedCanBeFound(self):
        self.setRoles(['Manager'])
        self.workflow.doActionFor(self.folder.doc, 'publish')
        self.assertTrue(self.catalog(getId='doc'))
 
    def testPublishedIsUnindexed(self):
        # Works here!
        self.setRoles(['Manager'])
    def testPublishedIsUnindexedIfOwnerDeletes(self):
        # Works here!
        self.setRoles(['Manager'])
        self.workflow.doActionFor(self.folder.doc, 'publish')
        self.setRoles(['Member'])

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testCatalogTool.py   Products.CMFPlone(Download)
    def testCanPasteCatalog(self):
        # Should be able to copy/paste a portal_catalog. Triggers
        # manage_afterAdd of portal_catalog thereby exposing another bug :-/
        self.setRoles(['Manager'])
        cb = self.portal.manage_copyObjects(['portal_catalog'])
    def testPastingCatalogPreservesTextIndexes(self):
        # Pasting the catalog should not cause indexes to be removed.
        self.setRoles(['Manager'])
        cb = self.portal.manage_copyObjects(['portal_catalog'])
        self.folder.manage_pasteObjects(cb)
    def testPublishedCanBeFound(self):
        self.setRoles(['Manager'])
        self.workflow.doActionFor(self.folder.doc, 'publish')
        self.assertTrue(self.catalog(getId='doc'))
 
    def testPublishedIsUnindexed(self):
        # Works here!
        self.setRoles(['Manager'])
    def testPublishedIsUnindexedIfOwnerDeletes(self):
        # Works here!
        self.setRoles(['Manager'])
        self.workflow.doActionFor(self.folder.doc, 'publish')
        self.setRoles(['Member'])

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testNavigationView.py   Products.CMFPlone(Download)
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')
        folder2.invokeFactory('Document', 'doc23')
        folder2.invokeFactory('File', 'file21')
        self.setRoles(['Member'])
 
    def testCreateNavTree(self):
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')
        folder2.invokeFactory('Document', 'doc23')
        folder2.invokeFactory('File', 'file21')
        self.setRoles(['Member'])
 
    def testCreateSitemap(self):
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testNavigationView.py   Products.CMFPlone(Download)
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')
        folder2.invokeFactory('Document', 'doc23')
        folder2.invokeFactory('File', 'file21')
        self.setRoles(['Member'])
 
    def testCreateNavTree(self):
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')
        folder2.invokeFactory('Document', 'doc23')
        folder2.invokeFactory('File', 'file21')
        self.setRoles(['Member'])
 
    def testCreateSitemap(self):
    def populateSite(self):
        self.setRoles(['Manager'])
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testContentPublishing.py   Products.CMFPlone(Download)
    def testPublishingSubobjects(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingSubobjectsAndExpireThem(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingWithoutSubobjects(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingNonDefaultPageLeavesFolderAlone(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.d1.content_status_modify('publish')
        self.assertEqual(self.workflow.getInfoFor(self.folder, 'review_state'),
    def testPublishingDefaultPagePublishesFolder(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.setDefaultPage('d1')
        self.folder.d1.content_status_modify('publish')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testContentPublishing.py   Products.CMFPlone(Download)
    def testPublishingSubobjects(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingSubobjectsAndExpireThem(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingWithoutSubobjects(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.invokeFactory('Folder', id='f1', title='Folder 1')
        self.folder.f1.invokeFactory('Document', id='d2', title='Doc 2')
    def testPublishingNonDefaultPageLeavesFolderAlone(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.d1.content_status_modify('publish')
        self.assertEqual(self.workflow.getInfoFor(self.folder, 'review_state'),
    def testPublishingDefaultPagePublishesFolder(self):
        self.setRoles(['Manager'])  # Make sure we can publish directly
        self.folder.invokeFactory('Document', id='d1', title='Doc 1')
        self.folder.setDefaultPage('d1')
        self.folder.d1.content_status_modify('publish')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testSecurity.py   Products.CMFPlone(Download)
        self.assertEqual('EVIL', self.portal.news.Title())
 
        self.setRoles(['Manager'])
        self.portal.news.setTitle('News')
        self.portal.plone_utils.renameObjectsByPaths(paths=['/plone/news'], new_ids=['news'], new_titles=['EVIL'])
        self.assertEqual('EVIL', self.portal.news.Title())
        self.portal.news.setTitle('News')
 
        self.setRoles(['Member'])
    def test_at_download(self):
        self.setRoles(['Manager'])
        self.portal.portal_workflow.setChainForPortalTypes(['File'], 'plone_workflow')
        self.portal.invokeFactory('File', 'test')
        self.portal.portal_workflow.doActionFor(self.portal.test, 'publish')
    def test_ftp(self):
        self.setRoles(['Manager', 'Owner'])
        self.portal.REQUEST.PARENTS = [self.app]
        res = self.portal.news.manage_FTPlist(self.portal.REQUEST)
        self.assertTrue(isinstance(res, basestring))
        self.portal.portal_workflow.doActionFor(self.portal.news, 'hide')
        self.setRoles(['Member'])

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testSecurity.py   Products.CMFPlone(Download)
        self.assertEqual('EVIL', self.portal.news.Title())
 
        self.setRoles(['Manager'])
        self.portal.news.setTitle('News')
        self.portal.plone_utils.renameObjectsByPaths(paths=['/plone/news'], new_ids=['news'], new_titles=['EVIL'])
        self.assertEqual('EVIL', self.portal.news.Title())
        self.portal.news.setTitle('News')
 
        self.setRoles(['Member'])
    def test_at_download(self):
        self.setRoles(['Manager'])
        self.portal.portal_workflow.setChainForPortalTypes(['File'], 'plone_workflow')
        self.portal.invokeFactory('File', 'test')
        self.portal.portal_workflow.doActionFor(self.portal.test, 'publish')
    def test_ftp(self):
        self.setRoles(['Manager', 'Owner'])
        self.portal.REQUEST.PARENTS = [self.app]
        res = self.portal.news.manage_FTPlist(self.portal.REQUEST)
        self.assertTrue(isinstance(res, basestring))
        self.portal.portal_workflow.doActionFor(self.portal.news, 'hide')
        self.setRoles(['Member'])

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testSecurityDeclarations.py   Products.CMFPlone(Download)
        self.assertTrue(checkPermission('Allow sendto', portal))
        # should be allowed as Manager
        self.setRoles(['Manager'])
        self.assertTrue(checkPermission('Allow sendto', portal))
        # should NOT be allowed as anonymous
    def test_allowsendto_changed(self):
        mtool = self.portal.portal_membership
        checkPermission = mtool.checkPermission
 
        self.setRoles(['Manager'])
        self.portal.manage_permission('Allow sendto', roles=('Manager',),
                                      acquire=False)
        self.setRoles(['Member'])
    def test_sendto_script_failes(self):
        # set permission to Manager only
        self.setRoles(['Manager'])
        self.portal.manage_permission('Allow sendto', roles=('Manager',),
                                      acquire=False)
        self.setRoles(['Member'])

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testSecurityDeclarations.py   Products.CMFPlone(Download)
        self.assertTrue(checkPermission('Allow sendto', portal))
        # should be allowed as Manager
        self.setRoles(['Manager'])
        self.assertTrue(checkPermission('Allow sendto', portal))
        # should NOT be allowed as anonymous
    def test_allowsendto_changed(self):
        mtool = self.portal.portal_membership
        checkPermission = mtool.checkPermission
 
        self.setRoles(['Manager'])
        self.portal.manage_permission('Allow sendto', roles=('Manager',),
                                      acquire=False)
        self.setRoles(['Member'])
    def test_sendto_script_failes(self):
        # set permission to Manager only
        self.setRoles(['Manager'])
        self.portal.manage_permission('Allow sendto', roles=('Manager',),
                                      acquire=False)
        self.setRoles(['Member'])

  1 | 2 | 3 | 4 | 5  Next