def setUpPloneSite(self, portal): quickInstallProduct(portal, 'wildcard.media') #applyProfile(portal, 'wildcard.media:default') portal.acl_users.userFolderAddUser('admin', 'secret', ['Manager'], []) login(portal, 'admin') portal.portal_workflow.setDefaultChain("simple_publication_workflow") setRoles(portal, TEST_USER_ID, ['Manager'])
def setUpPloneSite(self, portal): # Needed to make skins work applyProfile(portal, 'Products.CMFPlone:plone') applyProfile(portal, 'Products.CaseStudy:default') applyProfile(portal, 'gocept.linkchecker:default') quickInstallProduct(portal, 'osha.adaptation')
def setUpPloneSite(self, portal): request = FauxRequest() setRequest(request) applyProfile(portal, "plone.app.caching:default") applyProfile(portal, "design.plone.policy:default") quickInstallProduct(portal, "collective.MockMailHost") applyProfile(portal, "collective.MockMailHost:default")
def test_reinstallation_preserves_reports(self): """ Test that reinstalling the product does not wipe out custom reports. """ # Make some reports. analytics_tool = getToolByName(self.portal, 'portal_analytics') analytics_tool['foo'] = AnalyticsReport('foo') analytics_tool['bar'] = AnalyticsReport('bar') # Reinstall the product. setRoles(self.portal, TEST_USER_ID, ['Manager']) quickInstallProduct(self.portal, 'collective.googleanalytics', reinstall=False) # quick_installer = getToolByName(self.portal, "portal_quickinstaller") # quick_installer.reinstallProducts( # products=['collective.googleanalytics', ] # ) # Make sure the reports are still there. analytics_tool = getToolByName(self.portal, 'portal_analytics') report = analytics_tool.get('foo', None) self.assertNotEqual(report, None) report = analytics_tool.get('bar', None) self.assertNotEqual(report, None)
def setUpPloneSite(self, portal): """Set up Plone.""" # install stxnext.grayscale quickInstallProduct(portal, 'stxnext.grayscale') import transaction transaction.commit()
def test_reinstallation_preserves_settings(self): """ Test that reinstalling the product does not wipe out the settings stored on the portal_analytics tool. """ # Set some properties on the portal_analytics tool. analytics_tool = getToolByName(self.portal, 'portal_analytics') analytics_tool.auth_token = u'abc123' analytics_tool.cache_interval = 100 # Reinstall the product. setRoles(self.portal, TEST_USER_ID, ['Manager']) quickInstallProduct(self.portal, 'collective.googleanalytics', reinstall=False) # quick_installer = getToolByName(self.portal, "portal_quickinstaller") # import pdb; pdb.set_trace() # quick_installer.reinstallProducts( # products=['collective.googleanalytics', ] # ) # Make sure the properties are still set. analytics_tool = getToolByName(self.portal, 'portal_analytics') self.assertEqual(analytics_tool.auth_token, u'abc123') self.assertEqual(analytics_tool.cache_interval, 100)
def setUpPloneSite(self, portal): #quickInstallProduct(portal, 'Products.CMFSin') quickInstallProduct(portal, 'Products.PressRoom') applyProfile(portal, 'osha.dynamicpressroom:default') # Login as manager and create a test folder setRoles(portal, TEST_USER_ID, ['Manager']) login(portal, TEST_USER_NAME) portal.invokeFactory('Folder', 'folder')
def setUpPloneSite(self, portal): portal.acl_users.userFolderAddUser(SITE_OWNER_NAME, SITE_OWNER_PASSWORD, ['Manager'], []) login(portal, SITE_OWNER_NAME) setRoles(portal, TEST_USER_ID, ['Manager']) applyProfile(portal, 'cs.portlet.calendar:default') quickInstallProduct(portal, 'collective.MockMailHost') applyProfile(portal, 'collective.MockMailHost:default')
def setUpPloneSite(self, portal): pat.applyProfile(portal, 'ixds.covalent:default') for uid in ROLES.keys(): portal.portal_registration.addMember(uid, PASSWORD, ()) pat.setRoles(portal, uid, ROLES[uid]) pat.quickInstallProduct(portal, 'collective.MockMailHost') pat.applyProfile(portal, 'collective.MockMailHost:default')
def setUpPloneSite(self, portal): #applyProfile(portal, 'collective.analyticspanel:default') quickInstallProduct(portal, 'Products.LinguaPlone') quickInstallProduct(portal, 'Products.ATVocabularyManager') setRoles(portal, TEST_USER_ID, ['Member', 'Manager']) ltool = portal.portal_languages defaultLanguage = 'en' supportedLanguages = ['en', 'it', 'es'] ltool.manage_setLanguageSettings(defaultLanguage, supportedLanguages)
def setUpPloneSite(self, portal): portal.acl_users.userFolderAddUser( SITE_OWNER_NAME, SITE_OWNER_PASSWORD, ['Manager'], []) login(portal, SITE_OWNER_NAME) setRoles(portal, TEST_USER_ID, ['Manager']) applyProfile(portal, 'plone.restapi:default') applyProfile(portal, 'plone.restapi:testing') add_catalog_indexes(portal, DX_TYPES_INDEXES) set_available_languages() quickInstallProduct(portal, 'collective.MockMailHost') applyProfile(portal, 'collective.MockMailHost:default')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'Products.LinguaPlone') applyProfile(portal, 'slc.xliff:default') # Login as manager and create a test folder setRoles(portal, TEST_USER_ID, ['Manager']) login(portal, TEST_USER_NAME) portal.invokeFactory('Folder', 'folder') # Commit so that the test browser sees these objects portal.portal_catalog.clearFindAndRebuild() import transaction transaction.commit()
def setUpPloneSite(self, portal): portal.acl_users.userFolderAddUser( SITE_OWNER_NAME, SITE_OWNER_PASSWORD, ['Manager'], []) login(portal, SITE_OWNER_NAME) setRoles(portal, TEST_USER_ID, ['Manager']) applyProfile(portal, 'plone.restapi:default') applyProfile(portal, 'plone.restapi:testing') add_catalog_indexes(portal, DX_TYPES_INDEXES) set_available_languages() quickInstallProduct(portal, 'collective.MockMailHost') applyProfile(portal, 'collective.MockMailHost:default') states = portal.portal_workflow['simple_publication_workflow'].states states['published'].title = u'Published with accent é'.encode('utf8')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'plone.app.dexterity') quickInstallProduct(portal, 'seantis.reservation') quickInstallProduct(portal, 'plone.formwidget.datetime') quickInstallProduct(portal, 'plone.formwidget.recurrence') applyProfile(portal, 'seantis.reservation:default')
def setUpPloneSite(self, portal): portal.acl_users.userFolderAddUser( SITE_OWNER_NAME, SITE_OWNER_PASSWORD, ["Manager"], [] ) login(portal, SITE_OWNER_NAME) setRoles(portal, TEST_USER_ID, ["Manager"]) set_supported_languages(portal) applyProfile(portal, "plone.restapi:default") applyProfile(portal, "plone.restapi:testing") add_catalog_indexes(portal, DX_TYPES_INDEXES) set_available_languages() enable_request_language_negotiation(portal) quickInstallProduct(portal, "collective.MockMailHost") applyProfile(portal, "collective.MockMailHost:default") states = portal.portal_workflow["simple_publication_workflow"].states states["published"].title = "Published with accent é" # noqa: E501
def setUpPloneSite(self, portal): # Install into Plone site using portal_setup quickInstallProduct(portal, 'Products.DataGridField') quickInstallProduct(portal, 'Products.ATVocabularyManager') quickInstallProduct(portal, 'Products.MasterSelectWidget') if HAVE_LP: quickInstallProduct(portal, 'Products.LinguaPlone') applyProfile(portal, 'vs.org:default') portal.acl_users.userFolderAddUser('god', 'dummy', ['Manager'], []) setRoles(portal, 'god', ['Manager']) login(portal, 'god')
def setUpPloneSite(self, portal): pat.applyProfile(portal, self.gs_profile) pat.quickInstallProduct(portal, 'collective.MockMailHost') pat.applyProfile(portal, 'collective.MockMailHost:default') for uid in ROLES.keys(): portal.portal_registration.addMember(uid, PASSWORD, ()) pat.setRoles(portal, uid, ROLES[uid]) pat.login(portal, MANAGER) for uid in CNRD_ROLES.keys(): helpers.add_activated_cnrd_member( portal['people'], uid, role=CNRD_ROLES[uid], uid=uid, password=PASSWORD) pat.logout()
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'p4a.subtyper') applyProfile(portal, 'osha.fop:default') # Login as manager and create test content setRoles(portal, TEST_USER_ID, ['Manager']) login(portal, TEST_USER_NAME) portal.invokeFactory("Folder", "folder") portal.invokeFactory("Folder", "en") # Add and configure a FOP portal.en.invokeFactory("Folder", "belgium") portal.en.belgium.invokeFactory("Document", "index_html") be_fop = portal.en.belgium.index_html be_fop.setLayout('oshnetwork-member-view') alsoProvides(be_fop, IAnnotatedLinkList) be_fop.annotatedlinklist = ({ 'url': 'http://www.employment.belgium.be/', 'section': 'authorities', 'linktext': 'Link Text', 'title': 'Link Title'},) be_fop.addTranslation("de") alsoProvides(portal.en.belgium["index_html-de"], IAnnotatedLinkList)
def setUpPloneSite(self, portal): # Install all the Plone stuff + content (including the # Members folder) applyProfile(portal, 'Products.CMFPlone:plone') applyProfile(portal, 'Products.CMFPlone:plone-content') quickInstallProduct(portal, "Products.LinguaPlone") applyProfile(portal, 'slc.publications:default') # Login as manager and create a test folder setRoles(portal, TEST_USER_ID, ['Manager']) login(portal, TEST_USER_NAME) portal.invokeFactory('Folder', 'folder') # Enable Members folder from plone.app.controlpanel.security import ISecuritySchema security_adapter = ISecuritySchema(portal) security_adapter.set_enable_user_folders(True) # Commit so that the test browser sees these objects portal.portal_catalog.clearFindAndRebuild() import transaction transaction.commit()
def setUpPloneSite(self, portal): quickInstallProduct(portal, "plonetheme.nuplone") quickInstallProduct(portal, "euphorie.client") quickInstallProduct(portal, "euphorie.content") all_countries = euphorie.deployment.setuphandlers.COUNTRIES.copy() euphorie.deployment.setuphandlers.COUNTRIES = { key: all_countries[key] for key in all_countries if key in ( "de", "nl", ) } with mock.patch( "plone.i18n.utility.LanguageUtility.listSupportedLanguages", return_value=[ ("de", "German"), ("nl", "Dutch"), ], ): quickInstallProduct(portal, "euphorie.deployment.tests")
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'plone.app.dexterity') quickInstallProduct(portal, 'seantis.reservation') applyProfile(portal, 'seantis.reservation:default')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'collective.stripe') self.applyProfile(portal, 'collective.stripe:default') transaction.commit()
def setUpPloneSite(self, portal): # Set default workflow chain, because PLONE_FIXTURE has not one portal.portal_workflow.setDefaultChain('simple_publication_workflow') # Apply profile for ep.core quickInstallProduct(portal,'UNEP.cartagenareportingtool')
def setUpPloneSite(self, portal): setRoles(portal, TEST_USER_ID, ['Administrator']) quickInstallProduct(portal, 'emas.theme') self.applyProfile(portal, '%s:default' % PROJECTNAME) setRoles(portal, TEST_USER_ID, ['Member'])
def setUpPloneSite(self, portal): self.applyProfile(portal, 'eke.review:default') quickInstallProduct(portal, 'Products.PloneFormGen')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'plone.app.registry') quickInstallProduct(portal, 'collective.demositebadge')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'seantis.cover.people') applyProfile(portal, 'seantis.cover.people:default')
def testReinstall(self): portal = self.layer['portal'] quickInstallProduct(portal, 'gites.app')
def setUpPloneSite(self, portal): applyProfile(portal, "collective.volto.formsupport:default") applyProfile(portal, "plone.restapi:blocks") quickInstallProduct(portal, "collective.MockMailHost") applyProfile(portal, "collective.MockMailHost:default")
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'Products.VocabularyPickerWidget') quickInstallProduct(portal, 'Products.ATVocabularyManager') applyProfile(portal, 'osha.whoswho:default')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'collective.contentleadimage')
def setUpPloneSite(self, portal): # Workaround for the importVocabularies setuphandler calls # createSimpleVocabs which throws: # KeyError: 'ACTUAL_URL' portal.REQUEST["ACTUAL_URL"] = portal.REQUEST["SERVER_URL"] # Install all the Plone stuff + content (including the # Members folder) applyProfile(portal, 'Products.CMFPlone:plone') applyProfile(portal, 'Products.CMFPlone:plone-content') # quick install ATVocabularyManager or else we don't have # portal.portal_vocabularies quickInstallProduct(portal, "Products.ATVocabularyManager") quickInstallProduct(portal, "Products.PloneHelpCenter") quickInstallProduct(portal, "Products.ATCountryWidget") quickInstallProduct(portal, "Products.Collage") quickInstallProduct(portal, "plonetheme.classic") quickInstallProduct(portal, "Products.LinguaPlone") quickInstallProduct(portal, 'osha.adaptation') quickInstallProduct(portal, 'slc.googlesearch') applyProfile(portal, 'osha.policy:default') applyProfile(portal, 'osha.theme:default') applyProfile(portal, 'slc.linkcollection:default') # Needed to properly install content types applyProfile(portal, 'Products.RichDocument:default') applyProfile(portal, 'Products.RemoteProvider:default') applyProfile(portal, 'Products.CaseStudy:default') applyProfile(portal, 'Products.OSHContentLink:default') applyProfile(portal, 'slc.seminarportal:default') applyProfile(portal, 'slc.outdated:default') applyProfile(portal, 'Products.PloneHelpCenter:default') applyProfile(portal, 'osha.whoswho:default') # We need this imports here, otherwise we get an error from Products.CMFPlone.tests.utils import MockMailHost from Products.MailHost.interfaces import IMailHost # Mock MailHost mockmailhost = MockMailHost('MailHost') portal.MailHost = mockmailhost sm = portal.getSiteManager() sm.registerUtility(component=mockmailhost, provided=IMailHost) # Login as manager and create a test folder setRoles(portal, TEST_USER_ID, ['Manager']) login(portal, TEST_USER_NAME) portal.invokeFactory('Folder', 'folder') # Enable Members folder from plone.app.controlpanel.security import ISecuritySchema security_adapter = ISecuritySchema(portal) security_adapter.set_enable_user_folders(True) # Commit so that the test browser sees these objects portal.portal_catalog.clearFindAndRebuild() import transaction transaction.commit()
def setUpPloneSite(self, portal): quickInstallProduct(portal, "collective.logbook")
def setUpPloneSite(self, portal): self.applyProfile(portal, "collective.castle:default") quickInstallProduct(portal, "Products.CAS4PAS")
def setUpPloneSite(self, portal): self.applyProfile(portal, 'edrnsite.policy:default') setRoles(portal, TEST_USER_ID, ['Manager']) wfTool = getToolByName(portal, 'portal_workflow') wfTool.setDefaultChain('plone_workflow') quickInstallProduct(portal, 'plone.app.ldap')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'collective.chimpdrill') #self.applyProfile(portal, 'collective.chimpdrill:default') transaction.commit()
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'seantis.dir.contacts') applyProfile(portal, 'seantis.dir.contacts:default')
def testReinstall(self): portal = self.layer["portal"] quickInstallProduct(portal, "kuleuven.caching") quickInstallProduct(portal, "kuleuven.caching")
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'emas.transforms')
def setUpPloneSite(self, portal): quickInstallProduct(portal, 'seantis.placemap') applyProfile(portal, 'seantis.placemap:default')
def setUpPloneSite(self, portal): applyProfile(portal, 'twitter.search:default') quickInstallProduct(portal, 'tweepy') quickInstallProduct(portal, 'plone.app.registry') quickInstallProduct(portal, 'plone.app.z3cform') quickInstallProduct(portal, 'plone.directives.form')
def setUpPloneSite(self, portal): #: Install the package in the Plone site. quickInstallProduct(portal, 'Products.AD54Elements')