Skip to content

Commit

Permalink
Setup test fixture for Plone 5
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Mar 23, 2016
1 parent 012d85e commit 7ac2f67
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions src/sc/embedder/testing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# -*- coding: utf-8 -*-
"""Setup testing infrastructure.
For Plone 5 we need to install plone.app.contenttypes.
"""
from plone.app.robotframework.testing import AUTOLOGIN_LIBRARY_FIXTURE
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.testing import z2

import pkg_resources


try:
pkg_resources.get_distribution('plone.app.contenttypes')
except pkg_resources.DistributionNotFound:
from plone.app.testing import PLONE_FIXTURE
else:
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE as PLONE_FIXTURE


class Fixture(PloneSandboxLayer):

Expand All @@ -22,14 +35,14 @@ def setUpPloneSite(self, portal):
self.applyProfile(portal, 'sc.embedder:default')

FIXTURE = Fixture()

INTEGRATION_TESTING = IntegrationTesting(
bases=(FIXTURE,),
name='sc.embedder:Integration',
)
bases=(FIXTURE,), name='sc.embedder:Integration')

FUNCTIONAL_TESTING = FunctionalTesting(
bases=(FIXTURE, z2.ZSERVER_FIXTURE),
name='sc.embedder:Functional',
)
bases=(FIXTURE, z2.ZSERVER_FIXTURE), name='sc.embedder:Functional')

ROBOT_TESTING = FunctionalTesting(
bases=(FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, z2.ZSERVER_FIXTURE),
name='sc.embedder:Robot')
name='sc.embedder:Robot',
)

0 comments on commit 7ac2f67

Please sign in to comment.