def setUpZope(self, app, configurationContext):

        import collective.whathappened
        import collective.history
        self.loadZCML(package=collective.whathappened)
        self.loadZCML(package=collective.history)
        setupCoreSessions(app)
Example #2
0
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        if IS_PLONE_APP_MULTILINGUAL_2:
            z2.installProduct(app, 'Products.DateRecurringIndex')

        import ftw.inflator
        xmlconfig.file('configure.zcml', ftw.inflator,
                       context=configurationContext)

        xmlconfig.file('configure.zcml', ftw.inflator.tests,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml', plone.app.multilingual,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml', plone.app.dexterity,
                       context=configurationContext)

        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '</configure>',
            context=configurationContext)

        setupCoreSessions(app)
Example #3
0
    def setUpZope(self, app, configurationContext):
        # do not install pas plugins (doesnt work in tests)
        from opengever.ogds.base import hooks
        hooks._setup_scriptable_plugin = lambda *a, **kw: None

        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '  <include package="opengever.ogds.base" file="tests.zcml" />'
            '  <include package="opengever.base.tests" file="tests.zcml" />'
            '  <include package="opengever.testing" file="tests.zcml" />'
            '  <include package="opengever.setup.tests" />'
            '</configure>',
            context=configurationContext)

        z2.installProduct(app, 'plone.app.versioningbehavior')
        z2.installProduct(app, 'collective.taskqueue.pasplugin')
        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        setupCoreSessions(app)

        # Set max subobject limit to 0 -> unlimited
        # In tests this is set to 100 by default
        transient_object_container = app.temp_folder.session_data
        transient_object_container.setSubobjectLimit(0)

        os.environ['BUMBLEBEE_DEACTIVATE'] = "True"

        import opengever.base.tests.views
        xmlconfig.file('configure.zcml',
                       opengever.base.tests.views,
                       context=configurationContext)
Example #4
0
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml',
                       Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        import ftw.inflator
        xmlconfig.file('configure.zcml',
                       ftw.inflator,
                       context=configurationContext)

        xmlconfig.file('configure.zcml',
                       ftw.inflator.tests,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml',
                       plone.app.multilingual,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml',
                       plone.app.dexterity,
                       context=configurationContext)

        setupCoreSessions(app)
Example #5
0
 def setUpZope(self, app, configurationContext):
     xmlconfig.string(
         '<configure xmlns="http://namespaces.zope.org/zope">'
         '  <include package="z3c.autoinclude" file="meta.zcml" />'
         '  <includePlugins package="plone" />'
         '  <includePluginsOverrides package="plone" />'
         '</configure>',
         context=configurationContext)
     setupCoreSessions(app)
     z2.installProduct(app, 'ftw.shop')
Example #6
0
    def setUpZope(self, app, configurationContext):
        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'
            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'
            '</configure>',
            context=configurationContext)

        # Invoke SESSION
        setupCoreSessions(app)
        transaction.commit()
    def setUp(self):
        setupCoreSessions(self.layer['app'])

        self.portal = self.layer['portal']
        self.request = self.layer['request']
        setRoles(self.portal, TEST_USER_ID, ['Manager'])

        self.document = api.content.create(
            container=self.portal,
            id='doc1',
            title='Document 1',
            type='Document'
        )
Example #8
0
    def setUpZope(self, app, configurationContext):
        import ftw.blueprints
        xmlconfig.file('configure.zcml', ftw.blueprints,
                       context=configurationContext)

        import plone.dexterity
        xmlconfig.file('configure.zcml', plone.dexterity,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml', plone.app.dexterity,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml', plone.app.multilingual,
                       context=configurationContext)

        setupCoreSessions(app)
Example #9
0
    def setUpZope(self, app, configurationContext):
        import ftw.blueprints
        xmlconfig.file('configure.zcml',
                       ftw.blueprints,
                       context=configurationContext)

        import plone.dexterity
        xmlconfig.file('configure.zcml',
                       plone.dexterity,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml',
                       plone.app.dexterity,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml',
                       plone.app.multilingual,
                       context=configurationContext)

        setupCoreSessions(app)
Example #10
0
    def setUpZope(self, app, configurationContext):
        # do not install pas plugins (doesnt work in tests)
        from opengever.ogds.base import hooks
        hooks._setup_scriptable_plugin = lambda *a, **kw: None

        xmlconfig.string(
            '<configure xmlns="http://namespaces.zope.org/zope">'

            '  <include package="z3c.autoinclude" file="meta.zcml" />'
            '  <includePlugins package="plone" />'
            '  <includePluginsOverrides package="plone" />'

            '  <include package="opengever.core.tests" file="tests.zcml" />'
            '  <include package="opengever.ogds.base" file="tests.zcml" />'
            '  <include package="opengever.base.tests" file="tests.zcml" />'
            '  <include package="opengever.testing" file="tests.zcml" />'
            '  <include package="opengever.setup.tests" />'

            '</configure>',
            context=configurationContext)

        z2.installProduct(app, 'plone.app.versioningbehavior')
        z2.installProduct(app, 'collective.taskqueue.pasplugin')

        memory_session_factory()
        setupCoreSessions(app)

        # Set max subobject limit to 0 -> unlimited
        # In tests this is set to 100 by default
        transient_object_container = app.temp_folder.session_data
        transient_object_container.setSubobjectLimit(0)

        os.environ['BUMBLEBEE_DEACTIVATE'] = "True"

        import opengever.base.tests.views
        xmlconfig.file('configure.zcml',
                       opengever.base.tests.views,
                       context=configurationContext)
Example #11
0
    def setUpZope(self, app, configurationContext):
        import Products.CMFPlacefulWorkflow
        xmlconfig.file('configure.zcml', Products.CMFPlacefulWorkflow,
                       context=configurationContext)

        z2.installProduct(app, 'Products.CMFPlacefulWorkflow')

        import ftw.inflator
        xmlconfig.file('configure.zcml', ftw.inflator,
                       context=configurationContext)

        xmlconfig.file('configure.zcml', ftw.inflator.tests,
                       context=configurationContext)

        import plone.app.multilingual
        xmlconfig.file('configure.zcml', plone.app.multilingual,
                       context=configurationContext)

        import plone.app.dexterity
        xmlconfig.file('configure.zcml', plone.app.dexterity,
                       context=configurationContext)

        setupCoreSessions(app)
Example #12
0
    def setUpZope(self, app, configurationContext):
        setupCoreSessions(app)
        # Load ZCML
        import Products.CMFPlacefulWorkflow
        self.loadZCML('configure.zcml', package=Products.CMFPlacefulWorkflow)
        import five.grok
        self.loadZCML('configure.zcml', package=five.grok)

        import osha.hwccontent
        xmlconfig.file('configure.zcml',
                       osha.hwccontent,
                       context=configurationContext)
        # Why not do it like this?
        # self.loadZCML('configure.zcml', package=osha.hwccontent)

        # Apparently the mail template is not grokked properly, registering
        # manually
        xmlconfig.string("""<configure xmlns="http://namespaces.zope.org/zope">
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.ApprovePhase1MailTemplate"
                    name="mail_approve_phase_1"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationCreatedCreatorMailTemplate"
                    name="mail_organisation_created_creator"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationCreatedSiteOwnerMailTemplate"
                    name="mail_organisation_created_siteowner"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationSubmittedCreatorMailTemplate"
                    name="mail_organisation_submitted_creator"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationSubmittedSiteOwnerMailTemplate"
                    name="mail_organisation_submitted_siteowner"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationRejectedMailTemplate"
                    name="mail_organisation_rejected"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationPublishedCreatorMailTemplate"
                    name="mail_organisation_published_creator"
                    />
               </configure>
            """,
                         context=configurationContext)

        # Install products that use an old-style initialize() function
        z2.installProduct(app, 'Products.DateRecurringIndex')
Example #13
0
    def setUpZope(self, app, configurationContext):
        setupCoreSessions(app)
        # Load ZCML
        import Products.CMFPlacefulWorkflow
        self.loadZCML('configure.zcml', package=Products.CMFPlacefulWorkflow)
        import five.grok
        self.loadZCML('configure.zcml', package=five.grok)

        import osha.hwccontent
        xmlconfig.file(
            'configure.zcml',
            osha.hwccontent,
            context=configurationContext
        )
        # Why not do it like this?
        # self.loadZCML('configure.zcml', package=osha.hwccontent)

        # Apparently the mail template is not grokked properly, registering
        # manually
        xmlconfig.string(
            """<configure xmlns="http://namespaces.zope.org/zope">
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.ApprovePhase1MailTemplate"
                    name="mail_approve_phase_1"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationCreatedCreatorMailTemplate"
                    name="mail_organisation_created_creator"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationCreatedSiteOwnerMailTemplate"
                    name="mail_organisation_created_siteowner"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationSubmittedCreatorMailTemplate"
                    name="mail_organisation_submitted_creator"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationSubmittedSiteOwnerMailTemplate"
                    name="mail_organisation_submitted_siteowner"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationRejectedMailTemplate"
                    name="mail_organisation_rejected"
                    />
                <adapter
                    for="osha.hwccontent.organisation.IOrganisation
                         ZPublisher.HTTPRequest.HTTPRequest"
                    provides="grokcore.view.interfaces.IGrokView"
                    factory="osha.hwccontent.events.OrganisationPublishedCreatorMailTemplate"
                    name="mail_organisation_published_creator"
                    />
               </configure>
            """,
            context=configurationContext
        )

        # Install products that use an old-style initialize() function
        z2.installProduct(app, 'Products.DateRecurringIndex')
Example #14
0
# Suppress DeprecationWarnings, we really don't want any in these tests
from warnings import simplefilter
simplefilter('ignore', DeprecationWarning)

from AccessControl.SecurityManagement import newSecurityManager
from transaction import commit
from Products.Five import zcml
from Testing import ZopeTestCase
from Testing.ZopeTestCase.utils import setupCoreSessions
from Products.PloneTestCase import PloneTestCase
from Products.PloneTestCase.layer import PloneSite

import easyshop.carts
from plone.app import relations

setupCoreSessions()
ZopeTestCase.installProduct('SiteAccess')

ZopeTestCase.installProduct("EasyShop", "plone.app.relations")
PloneTestCase.setupPloneSite(products=['EasyShop', "plone.app.relations"])


class EasyShopCartsSite(PloneSite):
    @classmethod
    def setUp(cls):
        app = ZopeTestCase.app()
        portal = app.plone
        # login as admin (copied from `loginAsPortalOwner`)
        uf = app.acl_users
        user = uf.getUserById(PloneTestCase.portal_owner).__of__(uf)
        newSecurityManager(None, user)
Example #15
0
 def setUpZope(self, app, configurationContext):
     import edrnsite.vanity
     setupCoreSessions(app)
     self.loadZCML(package=edrnsite.vanity)
Example #16
0
 def _setup(self):
     # Transparently extend the base setup
     PloneTestCase.PloneTestCase._setup(self)
     utils.setupGlobalRequest(self.app.REQUEST)
     setupCoreSessions(self.app)
Example #17
0
# Suppress DeprecationWarnings, we really don't want any in these tests
from warnings import simplefilter
simplefilter('ignore', DeprecationWarning)

from AccessControl.SecurityManagement import newSecurityManager
from transaction import commit
from Products.Five import zcml
from Testing import ZopeTestCase
from Testing.ZopeTestCase.utils import setupCoreSessions
from Products.PloneTestCase import PloneTestCase
from Products.PloneTestCase.layer import PloneSite

import easyshop.carts
from plone.app import relations

setupCoreSessions()
ZopeTestCase.installProduct('SiteAccess') 

ZopeTestCase.installProduct("EasyShop", "plone.app.relations")
PloneTestCase.setupPloneSite(products=['EasyShop', "plone.app.relations"])

class EasyShopCartsSite(PloneSite):

    @classmethod
    def setUp(cls):
        app = ZopeTestCase.app()
        portal = app.plone
        # login as admin (copied from `loginAsPortalOwner`)
        uf = app.acl_users
        user = uf.getUserById(PloneTestCase.portal_owner).__of__(uf)
        newSecurityManager(None, user)
Example #18
0
    def setUpZope(self, app, configurationContext):
        import dexterity.membrane
        self.loadZCML(package=dexterity.membrane)

        import plone.app.dexterity
        self.loadZCML(package=plone.app.dexterity)

        import plone.app.versioningbehavior
        self.loadZCML(package=plone.app.versioningbehavior)

        import plone.app.collection
        self.loadZCML(package=plone.app.collection)

        import plone.namedfile
        self.loadZCML(package=plone.namedfile)

        import collective.z3cform.html5widgets
        self.loadZCML(package=collective.z3cform.html5widgets)

        import collective.js.jqueryui
        self.loadZCML(package=collective.js.jqueryui)

        import plone.app.versioningbehavior
        self.loadZCML(package=plone.app.versioningbehavior)

        import five.localsitemanager
        self.loadZCML(package=five.localsitemanager)

        import collective.indexing
        self.loadZCML(package=collective.indexing)

        import Products.membrane
        self.loadZCML(package=Products.membrane)
        z2.installProduct(app, 'Products.membrane')  # initialize

        import plone.app.contentrules
        self.loadZCML(package=plone.app.contentrules)

        import plonetheme.classic
        import plonetheme.jquerymobile
        self.loadZCML(package=plonetheme.classic)
        self.loadZCML(package=plonetheme.jquerymobile)

        import Products.DateRecurringIndex
        z2.installProduct(app, 'Products.DateRecurringIndex')

        import plone.app.event
        self.loadZCML(package=plone.app.event)

        import plone.app.contenttypes
        self.loadZCML(package=plone.app.contenttypes)

        import cioppino.twothumbs
        self.loadZCML(package=cioppino.twothumbs)
        z2.installProduct(app, 'cioppino.twothumbs')  # initialize

        import collective.etherpad
        self.loadZCML(package=collective.etherpad)

        import collective.favoriting
        self.loadZCML(package=collective.favoriting)

        import collective.fontawesome
        self.loadZCML(package=collective.fontawesome)

        import collective.history
        self.loadZCML(package=collective.history)

        import collective.js.datatables
        self.loadZCML(package=collective.js.datatables)

        import collective.localrolesdatatables
        self.loadZCML(package=collective.localrolesdatatables)

        import collective.mediaelementjs
        self.loadZCML(package=collective.mediaelementjs)

        import collective.memberdatatables
        self.loadZCML(package=collective.memberdatatables)

        import collective.polls
        self.loadZCML(package=collective.polls)

        import collective.portlet.favoriting
        self.loadZCML(package=collective.portlet.favoriting)
        z2.installProduct(app, 'collective.portlet.favoriting')

        import collective.portlet.localusers
        self.loadZCML(package=collective.portlet.localusers)
        z2.installProduct(app, 'collective.portlet.localusers')

        import collective.readitlater
        self.loadZCML(package=collective.readitlater)

        import collective.themeswitcher
        self.loadZCML(package=collective.themeswitcher)

        import collective.whathappened
        self.loadZCML(package=collective.whathappened)

        import collective.rcse
        self.loadZCML(package=collective.rcse)
        xmlconfig.includeOverrides(configurationContext,
                                   'overrides.zcml',
                                   package=collective.rcse)

        setupCoreSessions(app)