[CMF-checkins] CVS: CMF - test_Discussions.py:1.4 test_Document.py:1.12 test_Image.py:1.2 test_MetadataTool.py:1.2 test_NewsItem.py:1.3 test_utils.py:1.4

tseaver@digicool.com tseaver@digicool.com
Tue, 19 Jun 2001 15:00:35 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault/tests
In directory korak.digicool.com:/tmp/cvs-serv17724/CMFDefault/tests

Modified Files:
	test_Discussions.py test_Document.py test_Image.py 
	test_MetadataTool.py test_NewsItem.py test_utils.py 
Log Message:


 - Testing hygeine (make sure we run in isolated ZODB transactions).



--- Updated File test_Discussions.py in package CMF --
--- test_Discussions.py	2001/06/17 19:21:06	1.3
+++ test_Discussions.py	2001/06/19 19:00:03	1.4
@@ -48,12 +48,13 @@
         types_tool = self.types_tool = self.root.portal_types
     
     def tearDown( self ):
-        del self.root
+        del self.types_tool
+        del self.workflow_tool
+        del self.url_tool
         del self.discussion_tool
         del self.catalog_tool
-        del self.url_tool
-        del self.workflow_tool
-        del self.types_tool
+        del self.root
+        del self._policy
         get_transaction().abort()
 
     def test_policy( self ):

--- Updated File test_Document.py in package CMF --
--- test_Document.py	2001/06/05 23:03:02	1.11
+++ test_Document.py	2001/06/19 19:00:03	1.12
@@ -73,6 +73,12 @@
 
 class DocumentTests(unittest.TestCase):
 
+    def setUp( self ):
+        get_transaction().begin()
+
+    def tearDown( self ):
+        get_transaction().abort()
+
     def test_Empty(self):
         d = Document('foo')
         assert d.title == ''

--- Updated File test_Image.py in package CMF --
--- test_Image.py	2001/05/21 13:48:13	1.1
+++ test_Image.py	2001/06/19 19:00:03	1.2
@@ -8,6 +8,12 @@
 
 class TestImageElement(unittest.TestCase):
 
+    def setUp( self ):
+        get_transaction().begin()
+
+    def tearDown( self ):
+        get_transaction().abort()
+
     def test_EditWithEmptyFile(self):
         """ Test handling of empty file uploads """
         image = Image('testimage')

--- Updated File test_MetadataTool.py in package CMF --
--- test_MetadataTool.py	2001/04/28 22:57:00	1.1
+++ test_MetadataTool.py	2001/06/19 19:00:03	1.2
@@ -7,12 +7,14 @@
 class TestMetadataElementPolicy( unittest.TestCase ):
 
     def setUp( self ):
+        get_transaction().begin()
         self.sv_policy = MetadataElementPolicy( 0 )
         self.mv_policy = MetadataElementPolicy( 1 )
 
     def tearDown( self ):
         del self.sv_policy
         del self.mv_policy
+        get_transaction().abort()
 
     def test_emptySV( self ):
         assert not self.sv_policy.isMultiValued()

--- Updated File test_NewsItem.py in package CMF --
--- test_NewsItem.py	2001/06/05 23:03:47	1.2
+++ test_NewsItem.py	2001/06/19 19:00:03	1.3
@@ -44,6 +44,12 @@
 
 class NewsItemTests(unittest.TestCase):
 
+    def setUp( self ):
+        get_transaction().begin()
+
+    def tearDown( self ):
+        get_transaction().abort()
+
     def test_Empty(self):
         d = NewsItem('foo')
         assert d.title == ''

--- Updated File test_utils.py in package CMF --
--- test_utils.py	2001/03/29 15:59:25	1.3
+++ test_utils.py	2001/06/19 19:00:03	1.4
@@ -14,6 +14,12 @@
 
 Header: value
 '''
+
+    def setUp( self ):
+        get_transaction().begin()
+
+    def tearDown( self ):
+        get_transaction().abort()
     
     def test_NoBody( self ):
         headers, body = parseHeadersBody( '%s\n\n' % self.COMMON_HEADERS )