[Checkins] SVN: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/ make tests pass again after isolation refactoring
Godefroid Chapelle
gotcha at bubblenet.be
Mon Dec 27 05:12:47 EST 2010
Log message for revision 119153:
make tests pass again after isolation refactoring
Changed:
A gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation.py
D gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation_layer.py
U gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone3/test_plone3.py
U gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone4/test_plone4.py
U gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/testing.zcml
U gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/zope2/test_zope2.py
-=-
Copied: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation.py (from rev 119146, gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation_layer.py)
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation.py 2010-12-27 10:12:47 UTC (rev 119153)
@@ -0,0 +1,37 @@
+from zope.configuration import xmlconfig
+
+from plone.testing import Layer
+from plone.testing.z2 import STARTUP
+from plone.testing.z2 import FunctionalTesting
+
+from gocept.selenium import plonetesting
+import gocept.selenium.tests.isolation
+
+
+class Isolation(Layer):
+
+ defaultBases = (STARTUP, )
+
+ def setUp(self):
+ context = self['configurationContext']
+ xmlconfig.file('testing.zcml', package=plonetesting.tests,
+ context=context)
+
+ISOLATION = Isolation()
+
+FUNCTIONAL_ISOLATION = FunctionalTesting(bases=(ISOLATION,),
+ name="gocept.selenium:FunctionalIsolation")
+
+
+class IsolationTests(gocept.selenium.tests.isolation.IsolationTests):
+ """plone.testing implementation of methods needed by base class"""
+
+ @property
+ def selenium(self):
+ return self.layer['selenese']
+
+ def getDatabase(self):
+ return self.layer['zodbDB']
+
+ def getRootFolder(self):
+ return self.layer['app']
Deleted: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation_layer.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation_layer.py 2010-12-27 10:09:15 UTC (rev 119152)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/isolation_layer.py 2010-12-27 10:12:47 UTC (rev 119153)
@@ -1,22 +0,0 @@
-from zope.configuration import xmlconfig
-
-from plone.testing import Layer
-from plone.testing.z2 import STARTUP
-from plone.testing.z2 import FunctionalTesting
-
-from gocept.selenium import plonetesting
-
-
-class Isolation(Layer):
-
- defaultBases = (STARTUP, )
-
- def setUp(self):
- context = self['configurationContext']
- xmlconfig.file('testing.zcml', package=plonetesting.tests,
- context=context)
-
-ISOLATION = Isolation()
-
-FUNCTIONAL_ISOLATION = FunctionalTesting(bases=(ISOLATION,),
- name="gocept.selenium:FunctionalIsolation")
Modified: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone3/test_plone3.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone3/test_plone3.py 2010-12-27 10:09:15 UTC (rev 119152)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone3/test_plone3.py 2010-12-27 10:12:47 UTC (rev 119153)
@@ -21,13 +21,11 @@
from plone.app.testing.layers import SITE_OWNER_NAME
from plone.app.testing.layers import SITE_OWNER_PASSWORD
-import gocept.selenium.tests.isolation
from gocept.selenium import plonetesting
-from gocept.selenium.plonetesting.tests import isolation_layer
-from gocept.selenium.plonetesting.tests.zope2.test_zope2 import Zope2Tests
+from gocept.selenium.plonetesting.tests import isolation
PLONE_ISOLATION = FunctionalTesting(
- bases=(isolation_layer.ISOLATION, PLONE_FIXTURE),
+ bases=(isolation.ISOLATION, PLONE_FIXTURE),
name="gocept.selenium:PloneIsolation")
PLONE_SELENIUM = plone.testing.Layer(
@@ -36,16 +34,10 @@
class Plone3Tests(unittest.TestCase,
- gocept.selenium.tests.isolation.IsolationTests):
+ isolation.IsolationTests):
layer = PLONE_SELENIUM
- @property
- def selenium(self):
- # property needed to reuse IsolationTests without touching them
- # should not be needed in usual tests; see hereunder
- return self.layer['selenese']
-
def test_plone_login(self):
sel = self.selenium
sel.open('/plone')
@@ -58,5 +50,6 @@
def test_suite():
suite = unittest.makeSuite(Plone3Tests)
- suite.addTest(unittest.makeSuite(Zope2Tests))
+ from gocept.selenium.plonetesting.tests.zope2 import test_zope2
+ suite.addTest(test_zope2.test_suite())
return suite
Modified: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone4/test_plone4.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone4/test_plone4.py 2010-12-27 10:09:15 UTC (rev 119152)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/plone4/test_plone4.py 2010-12-27 10:12:47 UTC (rev 119153)
@@ -21,14 +21,11 @@
from plone.app.testing.layers import SITE_OWNER_NAME
from plone.app.testing.layers import SITE_OWNER_PASSWORD
-import gocept.selenium.zope2
-import gocept.selenium.tests.isolation
from gocept.selenium import plonetesting
-from gocept.selenium.plonetesting.tests import isolation_layer
-from gocept.selenium.plonetesting.tests.zope2.test_zope2 import Zope2Tests
+from gocept.selenium.plonetesting.tests import isolation
PLONE_ISOLATION = FunctionalTesting(
- bases=(isolation_layer.ISOLATION, PLONE_FIXTURE),
+ bases=(isolation.ISOLATION, PLONE_FIXTURE),
name="gocept.selenium:PloneIsolation")
PLONE_SELENIUM = plone.testing.Layer(
@@ -37,16 +34,10 @@
class Plone4Tests(unittest.TestCase,
- gocept.selenium.tests.isolation.IsolationTests):
+ isolation.IsolationTests):
layer = PLONE_SELENIUM
- @property
- def selenium(self):
- # property needed to reuse IsolationTests without touching them
- # should not be needed in usual tests; see hereunder
- return self.layer['selenese']
-
def test_plone_login(self):
sel = self.layer['selenese']
sel.open('/plone')
@@ -61,5 +52,6 @@
def test_suite():
suite = unittest.makeSuite(Plone4Tests)
- suite.addTest(unittest.makeSuite(Zope2Tests))
+ from gocept.selenium.plonetesting.tests.zope2 import test_zope2
+ suite.addTest(test_zope2.test_suite())
return suite
Modified: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/testing.zcml
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/testing.zcml 2010-12-27 10:09:15 UTC (rev 119152)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/testing.zcml 2010-12-27 10:12:47 UTC (rev 119153)
@@ -2,6 +2,6 @@
xmlns="http://namespaces.zope.org/zope">
<include package="Products.Five" />
- <include package="gocept.selenium.tests.fixture" />
+ <include package="gocept.selenium.tests.isolation" />
</configure>
Modified: gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/zope2/test_zope2.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/zope2/test_zope2.py 2010-12-27 10:09:15 UTC (rev 119152)
+++ gocept.selenium/trunk/src/gocept/selenium/plonetesting/tests/zope2/test_zope2.py 2010-12-27 10:12:47 UTC (rev 119153)
@@ -15,26 +15,19 @@
import plone.testing
from gocept.selenium import plonetesting
-import gocept.selenium.tests.isolation
-from gocept.selenium.plonetesting.tests import isolation_layer
+from gocept.selenium.plonetesting.tests import isolation
ZOPE2_ISOLATION = plone.testing.Layer(
- bases=(plonetesting.SELENIUM, isolation_layer.FUNCTIONAL_ISOLATION,),
+ bases=(plonetesting.SELENIUM, isolation.FUNCTIONAL_ISOLATION,),
name="gocept.selenium:Zope2")
class Zope2Tests(unittest.TestCase,
- gocept.selenium.tests.isolation.IsolationTests):
+ isolation.IsolationTests):
layer = ZOPE2_ISOLATION
- @property
- def selenium(self):
- # property needed to reuse IsolationTests without touching them
- # should not be needed in usual tests; see plone4 tests for example
- return self.layer['selenese']
-
def test_suite():
return unittest.makeSuite(Zope2Tests)
More information about the checkins
mailing list