Add plone.app.testing setup. For now we have to use PTC and p.a.testing at the same timeuntil we moved all tests to use p.a.testing. It does not make sense to write new tests for PTC.

This commit is contained in:
Timo Stollenwerk 2013-07-10 10:31:13 +02:00
parent 53912f4e03
commit 9f1459d591
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_NAME
from plone.app.testing import login
from plone.app.testing import setRoles
from plone.app.testing import applyProfile
from plone.app.testing import PloneSandboxLayer
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import IntegrationTesting
from plone.app.testing import FunctionalTesting
from zope.configuration import xmlconfig
class CollectiveSolr(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
# Load ZCML
import collective.solr
xmlconfig.file('configure.zcml',
collective.solr,
context=configurationContext)
def setUpPloneSite(self, portal):
applyProfile(portal, 'collective.solr:default')
setRoles(portal, TEST_USER_ID, ['Manager'])
login(portal, TEST_USER_NAME)
COLLECTIVE_SOLR_FIXTURE = CollectiveSolr()
COLLECTIVE_SOLR_INTEGRATION_TESTING = IntegrationTesting(
bases=(COLLECTIVE_SOLR_FIXTURE,),
name="CollectiveSolr:Integration")
COLLECTIVE_SOLR_FUNCTIONAL_TESTING = FunctionalTesting(
bases=(COLLECTIVE_SOLR_FIXTURE,),
name="CollectiveSolr:Functional")