# Tests for scripts behind folder_contents view # from cStringIO import StringIO from zExceptions import Forbidden from zope.interface import directlyProvides from zope import component from zope.app.container.interfaces import IObjectRemovedEvent from Products.CMFPlone.tests import PloneTestCase from Products.PloneTestCase.setup import default_user from Products.PloneTestCase.setup import default_password from Products.CMFPlone.tests.dummy import Item, ICantBeDeleted, \ disallow_delete_handler import transaction PloneTestCase.installProduct('SiteAccess', quiet=1) class TestFolderRename(PloneTestCase.PloneTestCase): # Tests for folder_rename and folder_rename_form def afterSetUp(self): self.catalog = self.portal.portal_catalog self.folder.invokeFactory('Folder', id='foo') self.folder.invokeFactory('Folder', id='bar') self.folder.foo.invokeFactory('Document', id='doc1') self.folder.bar.invokeFactory('Document', id='doc2') # folder_rename requires a non-GET request self.setRequestMethod('POST') def testTitleIsUpdatedOnTitleChange(self):
# # This test module demonstrates a problem caused by the removal of # a few lines of code from cAccessControl.c and ImplPython.c # See: http://mail.zope.org/pipermail/zope-checkins/2004-August/028152.html # # If an object with setDefaultAccess('deny') is used as the context for # a PythonScript, the script can no longer aquire tools from the portal # root. Rolling back the abovementioned checkin restores functionality. # from Products.CMFPlone.tests import PloneTestCase PloneTestCase.installProduct('PythonScripts') from App.class_init import InitializeClass from AccessControl import ClassSecurityInfo from OFS.SimpleItem import SimpleItem class AllowedItem(SimpleItem): id = 'allowed' security = ClassSecurityInfo() security.setDefaultAccess('allow') InitializeClass(AllowedItem) class DeniedItem(SimpleItem): id = 'denied' security = ClassSecurityInfo()
from cStringIO import StringIO from zExceptions import Forbidden from zope.interface import directlyProvides from zope import component from zope.container.interfaces import IObjectRemovedEvent from Products.CMFPlone.tests import PloneTestCase from Products.PloneTestCase.setup import default_user from Products.PloneTestCase.setup import default_password from Products.CMFPlone.tests.dummy import Item, ICantBeDeleted, \ disallow_delete_handler import transaction PloneTestCase.installProduct('SiteAccess', quiet=1) class TestFolderRename(PloneTestCase.PloneTestCase): # Tests for folder_rename and folder_rename_form def afterSetUp(self): self.catalog = self.portal.portal_catalog self.folder.invokeFactory('Folder', id='foo') self.folder.invokeFactory('Folder', id='bar') self.folder.foo.invokeFactory('Document', id='doc1') self.folder.bar.invokeFactory('Document', id='doc2') # folder_rename requires a non-GET request self.setRequestMethod('POST') self.setupAuthenticator() def testTitleIsUpdatedOnTitleChange(self): # Make sure our title is updated on the object title = 'Test Doc - Snooze!'
# # This test module demonstrates a problem caused by the removal of # a few lines of code from cAccessControl.c and ImplPython.c # See: http://mail.zope.org/pipermail/zope-checkins/2004-August/028152.html # # If an object with setDefaultAccess('deny') is used as the context for # a PythonScript, the script can no longer aquire tools from the portal # root. Rolling back the abovementioned checkin restores functionality. # from Products.CMFPlone.tests import PloneTestCase PloneTestCase.installProduct('PythonScripts') from Globals import InitializeClass from AccessControl import ClassSecurityInfo from OFS.SimpleItem import SimpleItem class AllowedItem(SimpleItem): id = 'allowed' security = ClassSecurityInfo() security.setDefaultAccess('allow') InitializeClass(AllowedItem) class DeniedItem(SimpleItem): id = 'denied' security = ClassSecurityInfo() security.setDefaultAccess('deny')
# ############################################################################## """COREBlog2 tests """ __author__ = 'Atsushi Shibata <*****@*****.**>' __docformat__ = 'plaintext' from Testing import ZopeTestCase from Products.CMFPlone.tests import PloneTestCase from Acquisition import aq_base from DateTime import DateTime from Products.PloneTestCase import PloneTestCase PloneTestCase.installProduct('COREBlog2') PloneTestCase.setupPloneSite(products=['COREBlog2']) blog_id = 'blog' entry_body = """ Header ====== Text, text, text * List * List """ entry_data = (
import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from Products.CMFPlone.tests import PloneTestCase from Products.PlonePopoll.content import * from Acquisition import aq_base from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl import getSecurityManager, Unauthorized from Products.CMFCore.utils import getToolByName from Products.PloneTestCase import PloneTestCase PloneTestCase.installProduct('PlonePopoll') PloneTestCase.setupPloneSite() try: import Log Log.LOG_LEVEL = Log.LOG_DEBUG Log.LOG_PROCESSOR = { Log.LOG_NONE: Log.logFile, Log.LOG_CRITICAL: Log.logFile, Log.LOG_ERROR: Log.logFile, Log.LOG_WARNING: Log.logFile,
############################################################################## """COREBlog2 tests """ __author__ = 'Atsushi Shibata <*****@*****.**>' __docformat__ = 'plaintext' from Testing import ZopeTestCase from Products.CMFPlone.tests import PloneTestCase from Acquisition import aq_base from DateTime import DateTime from Products.PloneTestCase import PloneTestCase PloneTestCase.installProduct('COREBlog2') PloneTestCase.setupPloneSite(products=['COREBlog2']) blog_id = 'blog' entry_body = """ Header ====== Text, text, text * List * List """ entry_data = (