From 589b98b13bfe41a805f367c4d29b986f1575c153 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 5 May 2009 01:24:25 +0000 Subject: - Applications which rely on ``zope.testing.cleanup.cleanUp` in unit tests can still use that function indefinitely. However, for maximum forward compatibility, they should import ``cleanUp`` from ``repoze.bfg.testing`` instead of from ``zope.testing.cleanup``. The BFG paster templates and docs have been changed to use this function instead of the ``zope.testing.cleanup`` version. --- docs/narr/MyProject/myproject/tests.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'docs/narr/MyProject') diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py index 4e0b2f8f4..6f287c02b 100644 --- a/docs/narr/MyProject/myproject/tests.py +++ b/docs/narr/MyProject/myproject/tests.py @@ -1,6 +1,5 @@ import unittest -from zope.testing.cleanup import cleanUp from repoze.bfg import testing class ViewTests(unittest.TestCase): @@ -14,13 +13,13 @@ class ViewTests(unittest.TestCase): """ cleanUp() is required to clear out the application registry between tests (done in setUp for good measure too) """ - cleanUp() + testing.cleanUp() def tearDown(self): """ cleanUp() is required to clear out the application registry between tests """ - cleanUp() + testing.cleanUp() def test_my_view(self): from myproject.views import my_view @@ -48,7 +47,7 @@ class ViewIntegrationTests(unittest.TestCase): registrations your application declares in its configure.zcml (including dependent registrations for repoze.bfg itself). """ - cleanUp() + testing.cleanUp() import myproject import zope.configuration.xmlconfig zope.configuration.xmlconfig.file('configure.zcml', @@ -56,7 +55,7 @@ class ViewIntegrationTests(unittest.TestCase): def tearDown(self): """ Clear out the application registry """ - cleanUp() + testing.cleanUp() def test_my_view(self): from myproject.views import my_view -- cgit v1.2.3