[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - testDirectives.py:1.1.2.3
Jim Fulton
jim@cvs.zope.org
Tue, 19 Feb 2002 11:05:12 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv7148/lib/python/Zope/Publisher/Browser/tests
Modified Files:
Tag: Zope-3x-branch
testDirectives.py
Log Message:
Refactored tests to use a global-data cleanup framework.
This avoids a lot of messy clean-up code needed for tests that
use global registries, such as component services.
It is really important to make sure global registries get registered
with this framework.
See the doc strings in Zope.Testing.CleannUp.
=== Zope3/lib/python/Zope/Publisher/Browser/tests/testDirectives.py 1.1.2.2 => 1.1.2.3 ===
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
from Zope.Publisher.Browser.tests.TestViews import IC, V1, VZMI, R1, RZMI
-from Zope.ComponentArchitecture import getView, getResource, _clear
+from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
+from Zope.ComponentArchitecture import getView, getResource
from Zope.ComponentArchitecture import getDefaultViewName
from cStringIO import StringIO
@@ -28,12 +29,9 @@
class Ob:
__implements__ = IC
-class Test(unittest.TestCase):
+class Test(CleanUp, unittest.TestCase):
# XXX: tests for other directives needed
-
- def tearDown(self):
- _clear()
def testView(self):