[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Fixed remaining 7 tests that could not be run in a loop.

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Jul 3 07:45:30 EDT 2004


Log message for revision 26091:
Fixed remaining 7 tests that could not be run in a loop.



-=-
Modified: Zope3/trunk/src/zope/app/form/tests/test_utility.py
===================================================================
--- Zope3/trunk/src/zope/app/form/tests/test_utility.py	2004-07-03 01:28:56 UTC (rev 26090)
+++ Zope3/trunk/src/zope/app/form/tests/test_utility.py	2004-07-03 11:45:30 UTC (rev 26091)
@@ -151,6 +151,12 @@
             >>> view.foo_widget is widget
             True
 
+        We now have to cleanup, so that these tests can be run in a loop. We
+        modified the 'IContent' interface saying that 'foo' is not mandatory,
+        so we have to change that back.
+
+            >>> IContent['foo'].required = True
+
         >>> tearDown()
         """
         

Modified: Zope3/trunk/src/zope/app/onlinehelp/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/onlinehelp/__init__.py	2004-07-03 01:28:56 UTC (rev 26090)
+++ Zope3/trunk/src/zope/app/onlinehelp/__init__.py	2004-07-03 11:45:30 UTC (rev 26091)
@@ -21,11 +21,13 @@
 
 import zope
 from zope.interface import providedBy
+from zope.testing import cleanup
 from zope.app import zapi
 
 from interfaces import IOnlineHelpTopic
 from onlinehelp import OnlineHelp
 
+
 # Global Online Help Instance
 path = os.path.join(os.path.dirname(zope.app.__file__),
                     'onlinehelp', 'help','welcome.stx')
@@ -98,3 +100,11 @@
                 break
 
     return topic
+
+
+def _clear():
+    global help
+    help.__init__(help.title, help.path)
+
+
+cleanup.addCleanUp(_clear)

Modified: Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py
===================================================================
--- Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py	2004-07-03 01:28:56 UTC (rev 26090)
+++ Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py	2004-07-03 11:45:30 UTC (rev 26091)
@@ -11,6 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""Tests of persistent schema wrappers.
+
+$Id$
+"""
 import unittest
 
 from persistent import Persistent, GHOST, UPTODATE
@@ -44,6 +48,11 @@
 
     klass = None # override in subclass
 
+    def tearDown(self):
+        # Make sure that we leave the environment as we found it.
+        global DUMMY
+        DUMMY.__init__(42)
+
     def testSaved(self):
         p = self.klass()
         p._p_oid = '\0\0\0\0\0\0hi'

Modified: Zope3/trunk/src/zope/app/security/tests/test_directives.py
===================================================================
--- Zope3/trunk/src/zope/app/security/tests/test_directives.py	2004-07-03 01:28:56 UTC (rev 26090)
+++ Zope3/trunk/src/zope/app/security/tests/test_directives.py	2004-07-03 11:45:30 UTC (rev 26091)
@@ -210,6 +210,10 @@
         
         self.context = xmlconfig.file("redefineperms.zcml", tests)
 
+    def tearDown(self):
+        global perms
+        perms.remove('zope.Security')
+
     def testRedefinePermission(self):
         self.assertEqual(perms, ['zope.Security'])
 



More information about the Zope3-Checkins mailing list