Exemple #1
0
    def setUpZope(self, app, configurationContext):
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        self.loadZCML(package=jazkarta.tesserae)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'jazkarta.tesserae:default')


JAZKARTA_TESSERAE_FIXTURE = JazkartaTesseraeLayer()


JAZKARTA_TESSERAE_INTEGRATION_TESTING = IntegrationTesting(
    bases=(JAZKARTA_TESSERAE_FIXTURE,),
    name='JazkartaTesseraeLayer:IntegrationTesting'
)


JAZKARTA_TESSERAE_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(JAZKARTA_TESSERAE_FIXTURE,),
    name='JazkartaTesseraeLayer:FunctionalTesting'
)


JAZKARTA_TESSERAE_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        JAZKARTA_TESSERAE_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
Exemple #2
0
    def setUpZope(self, app, configurationContext):
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        import plone.restapi
        self.loadZCML(package=plone.restapi)
        self.loadZCML(package=plone.gallery)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'plone.gallery:default')


PLONE_GALLERY_FIXTURE = PloneGalleryLayer()

PLONE_GALLERY_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONE_GALLERY_FIXTURE, ),
    name='PloneGalleryLayer:IntegrationTesting',
)

PLONE_GALLERY_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONE_GALLERY_FIXTURE, ),
    name='PloneGalleryLayer:FunctionalTesting',
)

PLONE_GALLERY_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        PLONE_GALLERY_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE,
    ),
    name='PloneGalleryLayer:AcceptanceTesting',
)
Exemple #3
0

class CollectivePermalinkLayer(PloneSandboxLayer):
    """Testing Layer for collective.permalink."""

    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,)

    def setUpZope(self, app, configurationContext):  # noqa
        """Setting up the Zope Server."""
        self.loadZCML(package=collective.permalink)

    def setUpPloneSite(self, portal):  # noqa
        """Setting up Plone Site."""
        applyProfile(portal, 'collective.permalink:default')


COLLECTIVE_PERMALINK_FIXTURE = \
    CollectivePermalinkLayer()


COLLECTIVE_PERMALINK_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_PERMALINK_FIXTURE,),
    name='CollectivePermalink UnitLayer:IntegrationTesting',
)


COLLECTIVE_PERMALINK_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_PERMALINK_FIXTURE,),
    name='CollectivePermalink UnitLayer:FunctionalTesting',
)
Exemple #4
0
from plone import api
from plone.app.testing import (
    FunctionalTesting,
    IntegrationTesting,
    PLONE_FIXTURE,
    PloneSandboxLayer,
)


class SetFieldLayer(PloneSandboxLayer):

    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        import collective.contentrules.setfield

        self.loadZCML(package=collective.contentrules.setfield)

    def setUpPloneSite(self, portal):
        if api.env.plone_version().startswith("5"):
            self.applyProfile(portal, "plone.app.contenttypes:default")


FIXTURE = SetFieldLayer()

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name="collective.contentrules.setfield:IntegrationTests")
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, ), name="collective.contentrules.setfield:FunctionalTests")
Exemple #5
0
    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,)

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import pkan.widgets
        self.loadZCML(package=pkan.widgets)

    def setUpPloneSite(self, portal):
        self.applyProfile(portal, 'pkan.widgets:default')


FIXTURE = Fixture()

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='pkan.widgets:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.widgets:Functional',
)


ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.widgets:Acceptance',
)

ROBOT_TESTING = Layer(name='pkan.widgets:Robot')
Exemple #6
0
        applyProfile(portal, 'ftw.subsite:default')
        applyProfile(portal, 'collective.MockMailHost:default')
        setRoles(portal, TEST_USER_ID, ['Manager'])
        login(portal, TEST_USER_NAME)


class FtwSubsiteWithoutApplyProfileLayer(FtwSubsiteIntegrationLayer):
    """Special layer, which does not install the ftw.subsite profile.
    This way the ftw.subsite browserlay will net be installed
    """

    def setUpPloneSite(self, portal):

        setRoles(portal, TEST_USER_ID, ['Manager'])
        login(portal, TEST_USER_NAME)


FTW_SUBSITE_FIXTURE = FtwSubsiteIntegrationLayer()
FTW_SUBSITE_INTEGRATION_TESTING = IntegrationTesting(
    bases=(FTW_SUBSITE_FIXTURE,), name="FtwSubsite:Integration")
FTW_SUBSITE_FUNCTIONAL_TESTING = FunctionalSplinterTesting(
    bases=(FTW_SUBSITE_FIXTURE,
           set_builder_session_factory(functional_session_factory)),
    name="FtwSubsite:Functional")

FTW_SUBSITE_SPECIAL_FIXTURE = FtwSubsiteWithoutApplyProfileLayer()
FTW_SUBSITE_SPECIAL_FUNCTIONAL_TESTING = FunctionalSplinterTesting(
    bases=(FTW_SUBSITE_SPECIAL_FIXTURE,
           set_builder_session_factory(functional_session_factory)),
    name="FtwSubsite:SpecialFunctional")
    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import ps.plone.realestatefont
        self.loadZCML(package=ps.plone.realestatefont)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'ps.plone.realestatefont:default')


PS_PLONE_REALESTATEFONT_FIXTURE = PsPloneRealestatefontLayer()


PS_PLONE_REALESTATEFONT_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PS_PLONE_REALESTATEFONT_FIXTURE,),
    name='PsPloneRealestatefontLayer:IntegrationTesting'
)


PS_PLONE_REALESTATEFONT_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PS_PLONE_REALESTATEFONT_FIXTURE,),
    name='PsPloneRealestatefontLayer:FunctionalTesting'
)


PS_PLONE_REALESTATEFONT_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        PS_PLONE_REALESTATEFONT_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
Exemple #8
0
            self.applyProfile(portal, 'plone.app.contenttypes:default')
        except Exception:
            pass

        # Install the collective.easyform product
        self.applyProfile(portal, 'collective.easyform:default')
        portal.acl_users.userFolderAddUser('admin', 'secret', ['Manager'], [])
        login(portal, 'admin')
        setRoles(portal, TEST_USER_ID, ['Manager'])
        portal.manage_changeProperties(
            **{'email_from_address': '*****@*****.**'})


FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='collective.easyform:Integration',
)
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, ),
    name='collective.easyform:Functional',
)
ACCEPTANCE_TESTING = FunctionalTesting(bases=(FIXTURE,
                                              AUTOLOGIN_LIBRARY_FIXTURE,
                                              ZSERVER_FIXTURE),
                                       name='collective.easyform:Acceptance')
ROBOT_TESTING = Layer(name='collective.easyform:Robot')


class EasyFormTestCase(TestCase):

    layer = INTEGRATION_TESTING
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        import plone.restapi

        self.loadZCML(package=plone.restapi)
        self.loadZCML(package=collective.defaultexcludedfromnav)

    def setUpPloneSite(self, portal):
        applyProfile(portal, "collective.defaultexcludedfromnav:default")


COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_FIXTURE = CollectiveDefaultexcludedfromnavLayer(
)

COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_FIXTURE, ),
    name="CollectiveDefaultexcludedfromnavLayer:IntegrationTesting",
)

COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_FIXTURE, ),
    name="CollectiveDefaultexcludedfromnavLayer:FunctionalTesting",
)

COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        COLLECTIVE_DEFAULTEXCLUDEDFROMNAV_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE,
    ),
    name="CollectiveDefaultexcludedfromnavLayer:AcceptanceTesting",
)
Exemple #10
0
class RescueareaCoreLayer(PloneSandboxLayer):

    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        self.loadZCML(package=rescuearea.core)

    def setUpPloneSite(self, portal):
        applyProfile(portal, "rescuearea.core:default")


RESCUEAREA_CORE_FIXTURE = RescueareaCoreLayer()

RESCUEAREA_CORE_INTEGRATION_TESTING = IntegrationTesting(
    bases=(RESCUEAREA_CORE_FIXTURE, ),
    name="RescueareaCoreLayer:IntegrationTesting")

RESCUEAREA_CORE_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(RESCUEAREA_CORE_FIXTURE, ),
    name="RescueareaCoreLayer:FunctionalTesting")

RESCUEAREA_CORE_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(RESCUEAREA_CORE_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name="RescueareaCoreLayer:AcceptanceTesting",
)
    def setUpZope(self, app, configurationContext):
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        self.loadZCML(package=plonetheme.tango)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'plonetheme.tango:default')


PLONETHEME_TANGO_FIXTURE = PlonethemeTangoLayer()


PLONETHEME_TANGO_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONETHEME_TANGO_FIXTURE,),
    name='PlonethemeTangoLayer:IntegrationTesting'
)


PLONETHEME_TANGO_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONETHEME_TANGO_FIXTURE,),
    name='PlonethemeTangoLayer:FunctionalTesting'
)


PLONETHEME_TANGO_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        PLONETHEME_TANGO_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
from plone.app.testing import PloneWithPackageLayer
from plone.app.testing import IntegrationTesting
from plone.app.testing import FunctionalTesting
from plone.testing import z2

import collective.request.player


COLLECTIVE_REQUEST_PLAYER = PloneWithPackageLayer(
    zcml_package=collective.request.player,
    zcml_filename='testing.zcml',
    gs_profile_id='collective.request.player:testing',
    name="COLLECTIVE_REQUEST_PLAYER")

COLLECTIVE_REQUEST_PLAYER_INTEGRATION = IntegrationTesting(
    bases=(COLLECTIVE_REQUEST_PLAYER, ),
    name="COLLECTIVE_REQUEST_PLAYER_INTEGRATION")

COLLECTIVE_REQUEST_PLAYER_FUNCTIONAL = FunctionalTesting(
    bases=(COLLECTIVE_REQUEST_PLAYER, z2.ZSERVER_FIXTURE),
    name="COLLECTIVE_REQUEST_PLAYER_FUNCTIONAL")
Exemple #13
0
    def setUpZope(self, app, configurationContext):
        # Load ZCML
        import emc.bokeh
        import emc.project
        #        import xtshzz.policy
        #        self.loadZCML(package=xtshzz.policy)

        xmlconfig.file('configure.zcml',
                       emc.project,
                       context=configurationContext)
        xmlconfig.file('configure.zcml',
                       emc.bokeh,
                       context=configurationContext)

    def tearDownZope(self, app):
        pass

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'emc.bokeh:default')
        applyProfile(portal, 'emc.project:default')


#        applyProfile(portal, 'xtshzz.policy:default')

FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(bases=(FIXTURE, ),
                                         name="emcproject:Integration")
FUNCTIONAL_TESTING = FunctionalTesting(bases=(FIXTURE, ),
                                       name="emcproject:Functional")
Exemple #14
0
from plone.app.testing import PloneWithPackageLayer
from plone.app.testing import IntegrationTesting
from plone.app.testing import FunctionalTesting

import plonekonf.talk

PLONEKONF_TALK = PloneWithPackageLayer(zcml_package=plonekonf.talk,
                                       zcml_filename='testing.zcml',
                                       gs_profile_id='plonekonf.talk:testing',
                                       name="PLONEKONF_TALK")

PLONEKONF_TALK_INTEGRATION = IntegrationTesting(
    bases=(PLONEKONF_TALK, ), name="PLONEKONF_TALK_INTEGRATION")

PLONEKONF_TALK_FUNCTIONAL = FunctionalTesting(bases=(PLONEKONF_TALK, ),
                                              name="PLONEKONF_TALK_FUNCTIONAL")
Exemple #15
0

class LibraryThemeLayer(PloneSandboxLayer):

    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        self.loadZCML(package=library.theme)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'library.theme:default')


LIBRARY_THEME_FIXTURE = LibraryThemeLayer()

LIBRARY_THEME_INTEGRATION_TESTING = IntegrationTesting(
    bases=(LIBRARY_THEME_FIXTURE, ),
    name='LibraryThemeLayer:IntegrationTesting')

LIBRARY_THEME_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(LIBRARY_THEME_FIXTURE, ),
    name='LibraryThemeLayer:FunctionalTesting')

LIBRARY_THEME_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(LIBRARY_THEME_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name='LibraryThemeLayer:AcceptanceTesting')
Exemple #16
0
        setRoles(portal, TEST_USER_ID, ['Manager'])

        applyProfile(portal, 'plone.restapi:default')

        applyProfile(portal, 'plone.app.jsonfield:default')

        # Apply Test profile
        applyProfile(portal, 'plone.app.jsonfield:testing')


PLONE_APP_JSON_FIELD_FIXTURE = PloneAppJSONFieldLayer()


PLONE_APP_JSON_FIELD_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONE_APP_JSON_FIELD_FIXTURE,),
    name='PloneAppJSONFieldLayer:IntegrationTesting'
)


PLONE_APP_JSON_FIELD_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONE_APP_JSON_FIELD_FIXTURE, z2.ZSERVER_FIXTURE),
    name='PloneAppJSONFieldLayer:FunctionalTesting'
)


PLONE_APP_JSON_FIELD_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        PLONE_APP_JSON_FIELD_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
Exemple #17
0
        def setUpZope(self, app, configurationContext):
            super(PloneAppContentAT, self).setUpZope(app, configurationContext)
            import Products.ATContentTypes
            xmlconfig.file('configure.zcml',
                           Products.ATContentTypes,
                           context=configurationContext)
            z2.installProduct(app, 'Products.ATContentTypes')

        def setUpPloneSite(self, portal):
            super(PloneAppContentAT, self).setUpPloneSite(portal)
            self.applyProfile(portal, 'Products.ATContentTypes:default')


PLONE_APP_CONTENT_FIXTURE = PloneAppContent()
PLONE_APP_CONTENT_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONE_APP_CONTENT_FIXTURE, ),
    name="PloneAppContent:Integration")
PLONE_APP_CONTENT_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONE_APP_CONTENT_FIXTURE, ),
    name="PloneAppContent:Functional")


# Dexterity test layers
PLONE_APP_CONTENT_DX_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONE_APP_CONTENTTYPES_FIXTURE, ),
    name="PloneAppContentDX:Integration")
PLONE_APP_CONTENT_DX_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONE_APP_CONTENTTYPES_FIXTURE, ),
    name="PloneAppContentDX:Functional")

Exemple #18
0
# -*- coding: utf-8 -*-
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.app.testing import IntegrationTesting
from plone.app.testing import FunctionalTesting

from zope.configuration import xmlconfig


class PloneAppRedirector(PloneSandboxLayer):

    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        import plone.app.redirector
        xmlconfig.file('configure.zcml',
                       plone.app.redirector,
                       context=configurationContext)


PLONE_APP_REDIRECTOR_FIXTURE = PloneAppRedirector()
PLONE_APP_REDIRECTOR_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONE_APP_REDIRECTOR_FIXTURE, ),
    name="PloneAppRedirector:Integration")
PLONE_APP_REDIRECTOR_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONE_APP_REDIRECTOR_FIXTURE, ),
    name="PloneAppRedirector:Functional")
Exemple #19
0
        """Set up Zope."""
        # Load ZCML
        import sll.theme
        self.loadZCML(package=sll.theme)

    def setUpPloneSite(self, portal):
        """Set up Plone."""
        # Install into Plone site using portal_setup
        self.applyProfile(portal, 'sll.theme:default')

    def tearDownZope(self, app):
        """Tear down Zope."""


FIXTURE = SllThemeLayer()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE,), name="SllThemeLayer:Integration")
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE,), name="SllThemeLayer:Functional")


class IntegrationTestCase(unittest.TestCase):
    """Base class for integration tests."""

    layer = INTEGRATION_TESTING


class FunctionalTestCase(unittest.TestCase):
    """Base class for functional tests."""

    layer = FUNCTIONAL_TESTING
        portal.portal_workflow.setDefaultChain("simple_publication_workflow")

        # Install into Plone site using portal_setup
        applyProfile(portal, 'plone.app.contenttypes:default')
        if not HAVE_PLONE_5:
            applyProfile(portal, 'plone.app.widgets:default')
        applyProfile(portal, 'plone.app.mosaic:default')
        if not HAVE_PLONE_5:
            applyProfile(portal, 'plone.app.mosaic:bbb')

        # Clear globalrequest
        clearRequest()


PLONE_APP_MOSAIC = PloneAppMosaic()
PLONE_APP_MOSAIC_INTEGRATION = IntegrationTesting(
    bases=(PLONE_APP_MOSAIC, ), name="PLONE_APP_MOSAIC_INTEGRATION")

PLONE_APP_MOSAIC_FUNCTIONAL = FunctionalTesting(
    bases=(PLONE_APP_MOSAIC, ), name="PLONE_APP_MOSAIC_FUNCTIONAL")

PLONE_APP_MOSAIC_ROBOT = FunctionalTesting(
    bases=(REMOTE_LIBRARY_BUNDLE_FIXTURE, PLONE_APP_MOSAIC,
           z2.ZSERVER_FIXTURE),
    name="PLONE_APP_MOSAIC_ROBOT")


class PloneAppMosaicNoPAC(PloneSandboxLayer):
    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        # Fix subrequest not fallbacking to wrong encoding in test environment:
        # Load any other ZCML that is required for your tests.
        # The z3c.autoinclude feature is disabled in the Plone fixture base
        # layer.
        import plone.restapi
        self.loadZCML(package=plone.restapi)
        self.loadZCML(package=medialog.datatablebehavior)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'medialog.datatablebehavior:default')


MEDIALOG_DATATABLEBEHAVIOR_FIXTURE = MedialogDatatablebehaviorLayer()


MEDIALOG_DATATABLEBEHAVIOR_INTEGRATION_TESTING = IntegrationTesting(
    bases=(MEDIALOG_DATATABLEBEHAVIOR_FIXTURE,),
    name='MedialogDatatablebehaviorLayer:IntegrationTesting',
)


MEDIALOG_DATATABLEBEHAVIOR_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(MEDIALOG_DATATABLEBEHAVIOR_FIXTURE,),
    name='MedialogDatatablebehaviorLayer:FunctionalTesting',
)


MEDIALOG_DATATABLEBEHAVIOR_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        MEDIALOG_DATATABLEBEHAVIOR_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE,
    ),
Exemple #22
0
        z2.uninstallProduct(app, 'collective.pfg.dexterity')
        z2.uninstallProduct(app, 'Products.DataGridField')
        z2.uninstallProduct(app, 'Products.PloneFormGen')

    def testSetUp(self):
        # XXX: How should we invalidate Dexterity fti.lookupSchema() cache?
        import plone.dexterity.schema
        for name in dir(plone.dexterity.schema.generated):
            if name.startswith('plone'):
                delattr(plone.dexterity.schema.generated, name)
        plone.dexterity.schema.SCHEMA_CACHE.clear()


COLLECTIVE_PFG_DEXTERITY_FIXTURE = CollectivePFGDexterityLayer()

COLLECTIVE_PFG_DEXTERITY_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_PFG_DEXTERITY_FIXTURE, ), name='Integration')
COLLECTIVE_PFG_DEXTERITY_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_PFG_DEXTERITY_FIXTURE, ), name='Functional')
COLLECTIVE_PFG_DEXTERITY_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_PFG_DEXTERITY_FIXTURE, z2.ZSERVER_FIXTURE),
    name='Acceptance')


class RemoteKeywordsLibrary(RemoteLibrary):
    """Robot Framework remote keywords library
    """
    def portal_type_is_installed(self, portal_type):
        ids = self.portal_types.objectIds()
        titles = map(lambda x: x.title, self.portal_types.objectValues())
        assert portal_type in ids + titles, \
            u"'{0:s}' was not found in portal types.".format(portal_type)
Exemple #23
0
        z2.installProduct(app, 'Products.DateRecurringIndex')

    def setUpPloneSite(self, portal):
        # Install into Plone site using portal_setup
        self.applyProfile(portal, 'brasil.gov.portal:default')
        portal.portal_workflow.setDefaultChain('simple_publication_workflow')

    def tearDownZope(self, app):
        # Uninstall products installed above
        # https://github.com/plone/plone.app.event/issues/81#issuecomment-23930996
        z2.uninstallProduct(app, 'Products.DateRecurringIndex')


FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='brasil.gov.portal:Integration',
)
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, ),
    name='brasil.gov.portal:Functional',
)


class InitContentFixture(Fixture):
    def setUpPloneSite(self, portal):
        super(InitContentFixture, self).setUpPloneSite(portal)
        portal.title = 'Portal Brasil'
        portal.description = u'Secretaria de Comunicação Social'
        wf = portal.portal_workflow
        wf.setDefaultChain('simple_publication_workflow')
        types = ('Document', 'Folder', 'Link', 'Topic', 'News Item')
Exemple #24
0
class SliderLayer(PloneSandboxLayer):

    defaultBases = (PLONE_FIXTURE, BUILDER_LAYER)

    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)

    def setUpPloneSite(self, portal):
        login(portal, TEST_USER_NAME)
        # Install into Plone site using portal_setup
        applyProfile(portal, 'ftw.slider:default')
        if IS_PLONE_5:
            applyProfile(portal, 'plone.app.contenttypes:default')


SLIDER_TAGS_FIXTURE = SliderLayer()
SLIDER_INTEGRATION_TESTING = IntegrationTesting(
    bases=(SLIDER_TAGS_FIXTURE,),
    name="ftw.slider:integration")
SLIDER_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(SLIDER_TAGS_FIXTURE,
           set_builder_session_factory(functional_session_factory)),
    name="ftw.slider:functional")
Exemple #25
0
from plone.testing import z2

import collective.js.tablednd


COLLECTIVE_JS_TABLEDND_FIXTURE = PloneWithPackageLayer(
    zcml_package=collective.js.tablednd,
    zcml_filename='testing.zcml',
    gs_profile_id='collective.js.tablednd:testing',
    name='CollectiveJsTableDNDLayer',
    additional_z2_products=()
)


COLLECTIVE_JS_TABLEDND_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_JS_TABLEDND_FIXTURE,),
    name='CollectiveJsTableDNDLayer:IntegrationTesting'
)


COLLECTIVE_JS_TABLEDND_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_JS_TABLEDND_FIXTURE,),
    name='CollectiveJsTableDNDLayer:FunctionalTesting'
)


COLLECTIVE_JS_TABLEDND_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        COLLECTIVE_JS_TABLEDND_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
class CollectiveDatatableReportingLayer(PloneSandboxLayer):

    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,)

    def setUpZope(self, app, configurationContext):
        self.loadZCML(package=collective.DataTable.reporting)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'collective.DataTable.reporting:default')


COLLECTIVE_DATATABLE_REPORTING_FIXTURE = CollectiveDatatableReportingLayer()


COLLECTIVE_DATATABLE_REPORTING_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_DATATABLE_REPORTING_FIXTURE,),
    name='CollectiveDatatableReportingLayer:IntegrationTesting'
)


COLLECTIVE_DATATABLE_REPORTING_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_DATATABLE_REPORTING_FIXTURE,),
    name='CollectiveDatatableReportingLayer:FunctionalTesting'
)


COLLECTIVE_DATATABLE_REPORTING_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        COLLECTIVE_DATATABLE_REPORTING_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
Exemple #27
0
        # Installs all the Plone stuff to setup defaul plone site.
        self.applyProfile(portal, 'Products.CMFPlone:plone')

        # Install portal content including the Members folder!.
        self.applyProfile(portal, 'Products.CMFPlone:plone-content')

        # Install into Plone site using portal_setup
        self.applyProfile(portal, 'santa.policy:default')

    def tearDownZope(self, app):
        """Tear down Zope."""


FIXTURE = SantaPolicyLayer()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE,), name="SantaPolicyLayer:Integration")
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE,), name="SantaPolicyLayer:Functional")


class IntegrationTestCase(BaseIntegrationTestCase):
    """Base class for integration tests."""

    layer = INTEGRATION_TESTING


class FunctionalTestCase(unittest.TestCase):
    """Base class for functional tests."""

    layer = FUNCTIONAL_TESTING
Exemple #28
0
import collective.task


class CollectiveTaskLayer(PloneSandboxLayer):

    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        xmlconfig.file('testing.zcml',
                       collective.task,
                       context=configurationContext)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'collective.task:default')


COLLECTIVE_TASK_FIXTURE = CollectiveTaskLayer()

COLLECTIVE_TASK_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_TASK_FIXTURE, ),
    name='CollectiveTaskLayer:IntegrationTesting')

COLLECTIVE_TASK_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_TASK_FIXTURE, ),
    name='CollectiveTaskLayer:FunctionalTesting')

COLLECTIVE_TASK_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_TASK_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name='CollectiveTaskLayer:AcceptanceTesting')
        """Set up Zope."""
        # Load ZCML
        self.loadZCML(package=collective.documentgenerator,
                      name='testing.zcml')
        z2.installProduct(app, 'collective.documentgenerator')

    def tearDownZope(self, app):
        """Tear down Zope."""
        z2.uninstallProduct(app, 'collective.documentgenerator')

NAKED_PLONE_FIXTURE = NakedPloneLayer(
    name='NAKED_PLONE_FIXTURE'
)

NAKED_PLONE_INTEGRATION = IntegrationTesting(
    bases=(NAKED_PLONE_FIXTURE,),
    name='NAKED_PLONE_INTEGRATION'
)


class DocumentgeneratorLayer(NakedPloneLayer):

    def setUpPloneSite(self, portal):
        """Set up Plone."""
        # Install into Plone site using portal_setup
        applyProfile(portal, 'collective.documentgenerator:default')

        # Login and create some test content
        setRoles(portal, TEST_USER_ID, ['Manager'])
        login(portal, TEST_USER_NAME)

        # Commit so that the test browser sees these objects
Exemple #30
0
        applyProfile(portal, 'collective.geotransform:default')
        setRoles(portal, TEST_USER_ID, ['Manager'])
        login(portal, TEST_USER_NAME)
        # we need to allow inputs tags for our robot tests
        remove_inputs_tag_filtering(portal)
        doc = api.content.create(
            type='Document',
            title='Simple Document',
            id='simple-document',
            container=portal,
        )
        doc.text = RichTextValue(
            TEXT,
            'text/html',
            'text/html',
        )
        api.content.transition(doc, 'publish')
        doc.reindexObject()
        transaction.commit()


COLLECTIVE_GEOTRANSFORM_FIXTURE = GeoTransformPackageLayer()

COLLECTIVE_GEOTRANSFORM_INTEGRATION_TESTING = IntegrationTesting(
    bases=(COLLECTIVE_GEOTRANSFORM_FIXTURE, ),
    name="CollectiveGeotransform:Integration")

COLLECTIVE_GEOTRANSFORM_ROBOT_TESTING = FunctionalTesting(
    bases=(COLLECTIVE_GEOTRANSFORM_FIXTURE, z2.ZSERVER_FIXTURE),
    name="CollectiveGeotransform:Robot")