[CMF-checkins] CVS: CMF/CMFCalendar/tests - test_Event.py:1.3.26.1 test_all.py:1.3.22.1

Shane Hathaway shane@cvs.zope.org
Wed, 20 Feb 2002 15:15:20 -0500


Update of /cvs-repository/CMF/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv27999/CMFCalendar/tests

Modified Files:
      Tag: cmf-pre-1_3-branch
	test_Event.py test_all.py 
Log Message:
Merged changes from head, with a small change: the types tool does not need
to be extended in such a complex way.  I took out the type_type registry and
the __bobo_traverse__ hook and replaced it with the original code with only
minor mods that give you the same extensibility without all the hacking.
(If anyone actually wants to use the extensibility, which I suspect no one
is actually interested in doing, I will happily provide instructions and
will create a corrected unit test.)


=== CMF/CMFCalendar/tests/test_Event.py 1.3 => 1.3.26.1 ===
 import Zope
-import unittest, string
-from Products.CMFCalendar.Event import *
+from unittest import TestCase, TestSuite, main, makeSuite
+from Products.CMFCalendar.Event import Event
 from DateTime import DateTime
 
-class TestEvent(unittest.TestCase):
-
-    def setUp( self ):
-        get_transaction().begin()
-
-    def tearDown( self ):
-        get_transaction().abort()
+class TestEvent(TestCase):
 
     def test_new(self):
         event = Event('test')
@@ -54,12 +47,9 @@
                          )
 
 def test_suite():
-    suite = unittest.TestSuite()
-    suite.addTest( unittest.makeSuite( TestEvent ) )
-    return suite
-
-def run():
-    unittest.TextTestRunner().run(test_suite())
+    return TestSuite((
+        makeSuite( TestEvent ),
+        ))
 
 if __name__ == '__main__':
-    run()
+    main(defaultTest='test_suite')


=== CMF/CMFCalendar/tests/test_all.py 1.3 => 1.3.22.1 ===
-import unittest
-
-from Products.CMFCalendar.tests import test_Event
+from unittest import main
+from Products.CMFCore.tests.base.utils import build_test_suite
 
 def test_suite():
-    suite = unittest.TestSuite()
-    suite.addTest( test_Event.test_suite() )
-    return suite
-
-def run():
-    if hasattr( unittest, 'JUnitTextTestRunner' ):
-        unittest.JUnitTextTestRunner().run( test_suite() )
-    else:
-        unittest.TextTestRunner( verbosity=0 ).run( test_suite() )
+    return build_test_suite('Products.CMFCalendar.tests',['test_Event'])
 
 if __name__ == '__main__':
-    run()
+    main(defaultTest='test_suite')