Exemple #1
0
from Products.CMFTestCase.ctc import Functional
from Products.CMFTestCase.ctc import installProduct
from Products.CMFTestCase.ctc import setupCMFSite
from Products.CMFTestCase.layer import onsetup

# BBB Zope 2.12
try:
    from Zope2.App import zcml
except ImportError:
    from Products.Five import zcml

# Setup a CMF site
installProduct('PloneLanguageTool')
installProduct('SiteAccess')

setupCMFSite(
    extension_profiles=['Products.PloneLanguageTool:PloneLanguageTool'])


def extraZCML():
    # XXX: Why isn't this loaded as part of site.zcml?
    import plone.i18n.locales
    zcml.load_config('configure.zcml', plone.i18n.locales)

onsetup(extraZCML)()


class TestCase(CMFTestCase):
    """Simple test case
    """

class FunctionalTestCase(Functional, TestCase):
Exemple #2
0
# -*- coding: utf-8 -*-
# BaseTestCase

from Products.CMFTestCase.ctc import CMFTestCase
from Products.CMFTestCase.ctc import setupCMFSite
from Products.CMFTestCase.ctc import installProduct

setupCMFSite(extension_profiles=['Products.CMFDiffTool:CMFDiffTool'])

class BaseTestCase(CMFTestCase):
    """This is a stub now, but in case you want to try
       something fancy on Your Branch (tm), put it here.
    """


try:
    from archetypes import schemaextender
    HAS_AT_SCHEMA_EXTENDER = True
except ImportError:
    HAS_AT_SCHEMA_EXTENDER = False
try:
    from Products.Five import fiveconfigure, zcml
    from Products.PloneTestCase import PloneTestCase as ptc
    from Products.PloneTestCase.layer import PloneSite
    HAS_PLONE = True
except ImportError:
    HAS_PLONE = False

if HAS_PLONE:
    class CMFDiffToolLayer(PloneSite):
        @classmethod
Exemple #3
0
# -*- coding: utf-8 -*-
# BaseTestCase

from Products.CMFTestCase.ctc import CMFTestCase
from Products.CMFTestCase.ctc import setupCMFSite
from Products.CMFTestCase.ctc import installProduct

setupCMFSite(extension_profiles=['Products.CMFDiffTool:CMFDiffTool'])


class BaseTestCase(CMFTestCase):
    """This is a stub now, but in case you want to try
       something fancy on Your Branch (tm), put it here.
    """


try:
    from archetypes import schemaextender
    HAS_AT_SCHEMA_EXTENDER = True
except ImportError:
    HAS_AT_SCHEMA_EXTENDER = False
try:
    from Products.Five import fiveconfigure, zcml
    from Products.PloneTestCase import PloneTestCase as ptc
    from Products.PloneTestCase.layer import PloneSite
    HAS_PLONE = True
except ImportError:
    HAS_PLONE = False

if HAS_PLONE:
Exemple #4
0
        'Products.Archetypes',
        EXTENSION)

# setup a CMF site
ZopeTestCase.installProduct('PythonScripts')
ZopeTestCase.installProduct('SiteErrorLog')
ZopeTestCase.installProduct('CMFFormController')
ZopeTestCase.installProduct('CMFQuickInstallerTool')
ZopeTestCase.installProduct('MimetypesRegistry')
ZopeTestCase.installProduct('PortalTransforms')
ZopeTestCase.installProduct('Archetypes')

setupSampleTypeProfile()
setupCMFSite(
    extension_profiles=['Products.CMFFormController:CMFFormController',
                        'Products.CMFQuickInstallerTool:CMFQuickInstallerTool',
                        'Products.MimetypesRegistry:MimetypesRegistry',
                        'Products.PortalTransforms:PortalTransforms',
                        'Products.Archetypes:Archetypes',
                        'Products.Archetypes:Archetypes_sampletypes'])

class ATTestCase(ZopeTestCase.ZopeTestCase):
    """Simple AT test case
    """
    layer = ZCML

class ATFunctionalTestCase(Functional, ATTestCase):
    """Simple AT test case for functional tests
    """
    layer = ZCML
Exemple #5
0

# setup a CMF site
ZopeTestCase.installProduct('PythonScripts')
ZopeTestCase.installProduct('SiteErrorLog')
ZopeTestCase.installProduct('CMFFormController')
ZopeTestCase.installProduct('CMFQuickInstallerTool')
ZopeTestCase.installProduct('MimetypesRegistry')
ZopeTestCase.installProduct('PortalTransforms')
ZopeTestCase.installProduct('Archetypes')

setupSampleTypeProfile()
setupCMFSite(extension_profiles=[
    'Products.CMFFormController:CMFFormController',
    'Products.CMFQuickInstallerTool:CMFQuickInstallerTool',
    'Products.MimetypesRegistry:MimetypesRegistry',
    'Products.PortalTransforms:PortalTransforms',
    'Products.Archetypes:Archetypes',
    'Products.Archetypes:Archetypes_sampletypes'
])


class ATTestCase(ZopeTestCase.ZopeTestCase):
    """Simple AT test case
    """
    layer = ZCML


class ATFunctionalTestCase(Functional, ATTestCase):
    """Simple AT test case for functional tests
    """
    layer = ZCML