[Checkins] SVN: gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/ Change grok tests to delegate to the isolation fixture, add ZODB isolation tests

Wolfgang Schnerring wosc at wosc.de
Sun Dec 26 09:27:30 EST 2010


Log message for revision 119131:
  Change grok tests to delegate to the isolation fixture, add ZODB isolation tests
  

Changed:
  U   gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/fixtures.py
  U   gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/tests.py

-=-
Modified: gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/fixtures.py
===================================================================
--- gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/fixtures.py	2010-12-26 14:19:06 UTC (rev 119130)
+++ gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/fixtures.py	2010-12-26 14:27:30 UTC (rev 119131)
@@ -12,6 +12,7 @@
 #
 ##############################################################################
 
+import gocept.selenium.tests.fixture.dummy
 import grok
 
 
@@ -25,13 +26,16 @@
         return '''<html><body>Hello from grok</body></html>'''
 
 
+# delegate to the common isolation fixture, but register the views grok-style
+
 class Set(grok.View):
     grok.name('set.html')
     grok.context(object)
 
     def render(self):
-        self.context.foo = 1
-        return u'setting done'
+        view = gocept.selenium.tests.fixture.dummy.Set()
+        view.context = self.context
+        return view()
 
 
 class Get(grok.View):
@@ -39,4 +43,16 @@
     grok.context(object)
 
     def render(self):
-        return str(getattr(self.context, 'foo', 0))
+        view = gocept.selenium.tests.fixture.dummy.Get()
+        view.context = self.context
+        return view()
+
+
+class IncrementVolatile(grok.View):
+    grok.name('inc-volatile.html')
+    grok.context(object)
+
+    def render(self):
+        view = gocept.selenium.tests.fixture.dummy.IncrementVolatile()
+        view.context = self.context
+        return view()

Modified: gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/tests.py
===================================================================
--- gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/tests.py	2010-12-26 14:19:06 UTC (rev 119130)
+++ gocept.selenium/branches/wosc-zodb-isolation/src/gocept/selenium/grok/tests.py	2010-12-26 14:27:30 UTC (rev 119131)
@@ -44,3 +44,6 @@
     gocept.selenium.grok.TestCase):
 
     layer = test_layer
+
+    def getDatabase(self):
+        return self.layer.db



More information about the checkins mailing list