Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
093504e
commit 402aca2
Showing
21 changed files
with
729 additions
and
896 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest2 as unittest | ||
|
||
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.app.testing import login | ||
from plone.app.testing import setRoles | ||
from plone.app.testing import TEST_USER_ID | ||
from plone.app.testing import TEST_USER_NAME | ||
from plone.testing import z2 | ||
|
||
|
||
class TinyMCELayer(PloneSandboxLayer): | ||
defaultBases = (PLONE_FIXTURE,) | ||
|
||
def setUpZope(self, app, configurationContext): | ||
"""Set up Zope.""" | ||
import Products.TinyMCE | ||
self.loadZCML(package=Products.TinyMCE) | ||
z2.installProduct(app, 'Products.TinyMCE') | ||
|
||
def setUpPloneSite(self, portal): | ||
"""Set up Plone.""" | ||
# Install into Plone site using portal_setup | ||
self.applyProfile(portal, 'Products.TinyMCE:TinyMCE') | ||
|
||
def tearDownZope(self, app): | ||
"""Tear down Zope.""" | ||
z2.uninstallProduct(app, 'Products.TinyMCE') | ||
|
||
|
||
FIXTURE = TinyMCELayer() | ||
INTEGRATION_TESTING = IntegrationTesting( | ||
bases=(FIXTURE,), name="TinyMCELayer:Integration") | ||
FUNCTIONAL_TESTING = FunctionalTesting( | ||
bases=(FIXTURE,), name="TinyMCELayer:Functional") | ||
|
||
|
||
class BaseTestCase(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.portal = self.layer['portal'] | ||
self.app = self.layer['app'] | ||
setRoles(self.portal, TEST_USER_ID, ['Manager']) | ||
login(self.portal, TEST_USER_NAME) | ||
|
||
|
||
class IntegrationTestCase(BaseTestCase): | ||
"""Base class for integration tests.""" | ||
|
||
layer = INTEGRATION_TESTING | ||
|
||
|
||
class FunctionalTestCase(BaseTestCase): | ||
"""Base class for functional tests.""" | ||
|
||
layer = FUNCTIONAL_TESTING |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.