[KSS-checkins] r45643 - kukit/kss.core/trunk/kss/core/tests
reebalazs at codespeak.net
reebalazs at codespeak.net
Tue Aug 14 11:03:03 CEST 2007
Author: reebalazs
Date: Tue Aug 14 11:03:03 2007
New Revision: 45643
Modified:
kukit/kss.core/trunk/kss/core/tests/base.py
Log:
Rearranging tests, allowing that the test class helpers can be used as mixin, thus a layer can be built up for Plone without the need to inherit from the ksslayer (which _may_ be a problem)
Modified: kukit/kss.core/trunk/kss/core/tests/base.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/tests/base.py (original)
+++ kukit/kss.core/trunk/kss/core/tests/base.py Tue Aug 14 11:03:03 2007
@@ -20,18 +20,14 @@
import warnings
from Testing.ZopeTestCase import ZopeTestCase, FunctionalTestCase
-from OFS.SimpleItem import SimpleItem
from zope import interface
-from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.app.testing import placelesssetup
+#from zope.app.testing import placelesssetup
import kss.core
from kss.core import KSSView
-
-
class KSSCoreLayer:
@classmethod
def setUp(cls):
@@ -77,14 +73,14 @@
@classmethod
def tearDown(cls):
- placelesssetup.tearDown()
+ pass # placelesssetup.tearDown()
class KSSLayer(KSSCoreLayer):
@classmethod
def setUp(cls):
try:
- from Products.Five.zcml import load_string, load_config
+ from Products.Five.zcml import load_config
except ImportError:
raise ImportError("KSSLayer requires Five to be installed.")
load_config('meta.zcml', package=kss.core)
@@ -101,8 +97,7 @@
class IDebugRequest(IBrowserRequest):
'The debug request'
-class KSSViewTestCase(ZopeTestCase):
- layer = KSSLayer
+class KSSViewTestCaseMixin:
def loadCoreConfig(self, kss_core=True):
warnings.warn(
@@ -122,6 +117,9 @@
request,
interface.directlyProvidedBy(request) + IDebugRequest)
+class KSSViewTestCase(ZopeTestCase, KSSViewTestCaseMixin):
+ layer = KSSLayer
+
class KSSViewFunctionalTestCase(FunctionalTestCase, KSSViewTestCase):
'Functional test base'
More information about the Kukit-checkins
mailing list