def setUp(cls): # load zcml fiveconfigure.debug_mode = True for pkg in packages: module = __import__(pkg) for comp in pkg.split('.')[1:]: module = getattr(module, comp) load_config('configure.zcml', module) fiveconfigure.debug_mode = False # install packages (products cannot be loaded from the layer) for pkg in packages: installPackage(pkg, quiet=quiet) # import profile root = app() prof = 'profile-%s' % profile tool = getToolByName(root.plone, 'portal_setup') tool.runAllImportStepsFromProfile(prof, purge_old=False) # login as admin (copied from `loginAsPortalOwner`) and # create some sample content uf = root.acl_users user = uf.getUserById(PloneTestCase.portal_owner).__of__(uf) newSecurityManager(None, user) if create: create(root.plone) # and commit the changes commit() close(root)
def setUp(cls): installProduct('salesforcebaseconnector') # add the connector root = app() portal = root.plone portal.manage_addProduct['salesforcebaseconnector'].manage_addTool('Salesforce Base Connector', None) portal.portal_salesforcebaseconnector.setCredentials(sfconfig.USERNAME, sfconfig.PASSWORD) # and commit the changes commit() close(root)
def setUp(cls): installProduct('salesforcebaseconnector') # add the connector root = app() portal = root.cmf portal.manage_addProduct['salesforcebaseconnector'].manage_addTool( 'Salesforce Base Connector', None) portal.portal_salesforcebaseconnector.setCredentials( sfconfig.USERNAME, sfconfig.PASSWORD) # and commit the changes commit() close(root)
def tearDown(cls): root = app() # login as admin (copied from `loginAsPortalOwner`) and # remove the sample content again... uf = root.acl_users user = uf.getUserById(PloneTestCase.portal_owner).__of__(uf) newSecurityManager(None, user) if destroy: destroy(root.plone) # commit the cleanup... commit() close(root)
def setUp(cls): fiveconfigure.debug_mode = True import collective.classification zcml.load_config('configure.zcml', collective.classification) fiveconfigure.debug_mode = False installPackage('collective.classification',quiet=True) # import the default profile root = app() portal = root.plone tool = getToolByName(portal, 'portal_setup') profile = 'profile-collective.classification:default' tool.runAllImportStepsFromProfile(profile, purge_old=False) # and commit the changes commit() close(root)
def setUp(cls): root = app() portal = root.plone # load zcml & install the package metaconfigure.debug_mode = True from plone.app.folder import tests load_config('testing.zcml', tests) metaconfigure.debug_mode = False installPackage('plone.app.folder', quiet=True) # import replacement profile profile = 'profile-plone.app.folder:default' tool = getToolByName(portal, 'portal_setup') tool.runAllImportStepsFromProfile(profile, purge_old=False) # make sure it's loaded... types = getToolByName(portal, 'portal_types') assert types.getTypeInfo('Folder').product == 'plone.app.folder' # and commit the changes commit() close(root)
def setUp(cls): metaconfigure.debug_mode = True import plone.app.dexterity zcml.load_config('meta.zcml', plone.app.dexterity) zcml.load_config('configure.zcml', plone.app.dexterity) metaconfigure.debug_mode = False # import the default profile root = app() portal = root.plone setHooks() setSite(portal) tool = getToolByName(portal, 'portal_setup') profile = 'profile-plone.app.dexterity:default' tool.runAllImportStepsFromProfile(profile, purge_old=False) setSite(None) # and commit the changes commit() close(root)
def setUp(cls): metaconfigure.debug_mode = True import collective.megaphone zcml.load_config('configure.zcml', collective.megaphone) if HAS_SALESFORCE: import Products.salesforcepfgadapter zcml.load_config('configure.zcml', Products.salesforcepfgadapter) metaconfigure.debug_mode = False installPackage('plone.app.z3cform') installPackage('collective.megaphone') root = app() portal = root.plone # set up sessions ztc.utils.setupCoreSessions(root) root.REQUEST.SESSION = Session() # add Salesforce base connector if HAS_SALESFORCE: portal.manage_addProduct['salesforcebaseconnector'].manage_addTool('Salesforce Base Connector', None) portal.portal_salesforcebaseconnector.setCredentials(sfconfig.USERNAME, sfconfig.PASSWORD) # add root user root.acl_users.userFolderAddUser('root', 'secret', ['Manager'], []) # import profiles setHooks() setSite(portal) tool = getToolByName(portal, 'portal_setup') tool.runAllImportStepsFromProfile('profile-collective.megaphone:default', purge_old=False) if HAS_SALESFORCE: tool.runAllImportStepsFromProfile('profile-Products.salesforcepfgadapter:default', purge_old=False) setSite(None) # use mock mailhost portal.MailHost = MockMailHost('MailHost') portal.email_from_address = '*****@*****.**' # and commit the changes commit() close(root)
def setUp(cls): # load zcml & install packages metaconfigure.debug_mode = True from plone.app import imaging zcml.load_config('configure.zcml', imaging) metaconfigure.debug_mode = False # import replacement profiles root = app() portal = root.plone tool = getToolByName(portal, 'portal_setup') profile = 'profile-plone.app.blob:file-replacement' tool.runAllImportStepsFromProfile(profile, purge_old=False) # make sure it's loaded... types = getToolByName(portal, 'portal_types') assert types.getTypeInfo('File').product == 'plone.app.blob' # allow creating the replaced types types.getTypeInfo('ATFile').global_allow = True # and commit the changes commit() close(root)
def setUp(cls): """ setUp """ root = app() portal = root.plone # load zcml & install the package metaconfigure.debug_mode = True import eea.jquery load_config('configure.zcml', eea.jquery) load_config('testing.zcml', eea.jquery) metaconfigure.debug_mode = False installPackage('eea.jquery', quiet=True) # import jquery profiles profile = 'profile-eea.jquery:all' tool = getToolByName(portal, 'portal_setup') tool.runAllImportStepsFromProfile(profile, purge_old=False) # and commit the changes commit() close(root)
def setUp(cls): # load zcml metaconfigure.debug_mode = True from plone.app.blob import tests zcml.load_config('testing.zcml', tests) from Products import LinguaPlone zcml.load_config('configure.zcml', LinguaPlone) metaconfigure.debug_mode = False # install packages, import profiles... installPackage('plone.app.blob', quiet=True) installProduct('LinguaPlone', quiet=True) root = app() portal = root.plone profile = 'profile-plone.app.blob:testing-lingua' tool = getToolByName(portal, 'portal_setup') tool.runAllImportStepsFromProfile(profile, purge_old=False) # make sure it's loaded... types = getToolByName(portal, 'portal_types') assert types.getTypeInfo('BlobelFish') # and commit the changes commit() close(root)
def setUp(cls): # Please be aware that part of the setup of tests # is the import of db in the __init__ file in # the same module as this class. # For more information, look at testing3rdparty.txt # load zcml & install packages metaconfigure.debug_mode = True from plone.app.blob import tests zcml.load_config('testing.zcml', tests) metaconfigure.debug_mode = False installPackage('plone.app.blob', quiet=True) # import the default profile root = app() portal = root.plone tool = getToolByName(portal, 'portal_setup') profile = 'profile-plone.app.blob:sample-type' tool.runAllImportStepsFromProfile(profile, purge_old=False) # make sure it's loaded... types = getToolByName(portal, 'portal_types') assert types.getTypeInfo('Blob').product == 'plone.app.blob' # and commit the changes commit() close(root)