[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/generations/browser/ merge ftests into test so that tests are run from the default testrunner

Bernd Dorn bernd.dorn at lovelysystems.com
Tue Mar 27 03:42:15 EDT 2007


Log message for revision 73670:
  merge ftests into test so that tests are run from the default testrunner

Changed:
  D   Zope3/trunk/src/zope/app/generations/browser/ftests.py
  U   Zope3/trunk/src/zope/app/generations/browser/tests.py

-=-
Deleted: Zope3/trunk/src/zope/app/generations/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/generations/browser/ftests.py	2007-03-27 07:35:13 UTC (rev 73669)
+++ Zope3/trunk/src/zope/app/generations/browser/ftests.py	2007-03-27 07:42:15 UTC (rev 73670)
@@ -1,85 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional tests for Database generations.
-
-$Id$
-"""
-import unittest
-
-from zope.app.testing import ztapi, functional
-from zope.app.generations.generations import SchemaManager, generations_key
-from zope.app.generations.interfaces import ISchemaManager
-from zope.app.generations.testing import GenerationsLayer
-
-class TestDatabaseSchema(functional.BrowserTestCase):
-
-    def test(self):
-        functional.BrowserTestCase.setUp(self)
-        
-        root = self.getRootFolder()._p_jar.root()
-        appkey = 'zope.app.generations.demo'
-        root[generations_key][appkey] = 0
-        self.commit()
-        manager = SchemaManager(0, 3, 'zope.app.generations.demo')
-
-        ztapi.provideUtility(ISchemaManager, manager, appkey)
-
-        response = self.publish('/++etc++process/@@generations.html',
-                                basic='globalmgr:globalmgrpw')
-        body = response.getBody()
-        body = ' '.join(body.split())
-        expect = ('zope.app.generations.demo</a> </td> '
-                  '<td>0</td> <td>3</td> <td>0</td> '
-                  '<td> <input type="submit" value=" evolve " '
-                  'name="evolve-app-zope.app.generations.demo"> </td>')
-        self.assert_(body.find(expect) > 0)
-
-        response = self.publish('/++etc++process/@@generations.html'
-                                '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='globalmgr:globalmgrpw')
-        body = response.getBody()
-        body = ' '.join(body.split())
-        expect = ('zope.app.generations.demo</a> </td> '
-                  '<td>0</td> <td>3</td> <td>1</td> '
-                  '<td> <input type="submit" value=" evolve " '
-                  'name="evolve-app-zope.app.generations.demo"> </td>')
-        self.assert_(body.find(expect) > 0)
-
-        response = self.publish('/++etc++process/@@generations.html'
-                                '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='globalmgr:globalmgrpw')
-        body = response.getBody()
-        body = ' '.join(body.split())
-        expect = ('zope.app.generations.demo</a> </td> '
-                  '<td>0</td> <td>3</td> <td>2</td> '
-                  '<td> <input type="submit" value=" evolve " '
-                  'name="evolve-app-zope.app.generations.demo"> </td>')
-        self.assert_(body.find(expect) > 0)
-
-        response = self.publish('/++etc++process/@@generations.html'
-                                '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='globalmgr:globalmgrpw')
-        body = response.getBody()
-        body = ' '.join(body.split())
-        expect = ('zope.app.generations.demo</a> </td> '
-                  '<td>0</td> <td>3</td> <td>3</td> '
-                  '<td> <span>')
-        self.assert_(body.find(expect) > 0)
-
-        ztapi.unprovideUtility(ISchemaManager, appkey)
-
-        
-def test_suite():
-    TestDatabaseSchema.layer = GenerationsLayer
-    return unittest.makeSuite(TestDatabaseSchema)

Modified: Zope3/trunk/src/zope/app/generations/browser/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/generations/browser/tests.py	2007-03-27 07:35:13 UTC (rev 73669)
+++ Zope3/trunk/src/zope/app/generations/browser/tests.py	2007-03-27 07:42:15 UTC (rev 73670)
@@ -17,12 +17,76 @@
 """
 import unittest
 from zope.testing.doctestunit import DocTestSuite
+from zope.app.generations.testing import GenerationsLayer
+from zope.app.testing import ztapi, functional
+from zope.app.generations.generations import SchemaManager, generations_key
+from zope.app.generations.interfaces import ISchemaManager
 
+class TestDatabaseSchema(functional.BrowserTestCase):
 
+    def test(self):
+        functional.BrowserTestCase.setUp(self)
+        
+        root = self.getRootFolder()._p_jar.root()
+        appkey = 'zope.app.generations.demo'
+        root[generations_key][appkey] = 0
+        self.commit()
+        manager = SchemaManager(0, 3, 'zope.app.generations.demo')
+
+        ztapi.provideUtility(ISchemaManager, manager, appkey)
+
+        response = self.publish('/++etc++process/@@generations.html',
+                                basic='globalmgr:globalmgrpw')
+        body = response.getBody()
+        body = ' '.join(body.split())
+        expect = ('zope.app.generations.demo</a> </td> '
+                  '<td>0</td> <td>3</td> <td>0</td> '
+                  '<td> <input type="submit" value=" evolve " '
+                  'name="evolve-app-zope.app.generations.demo"> </td>')
+        self.assert_(body.find(expect) > 0)
+
+        response = self.publish('/++etc++process/@@generations.html'
+                                '?evolve-app-zope.app.generations.demo=evolve',
+                                basic='globalmgr:globalmgrpw')
+        body = response.getBody()
+        body = ' '.join(body.split())
+        expect = ('zope.app.generations.demo</a> </td> '
+                  '<td>0</td> <td>3</td> <td>1</td> '
+                  '<td> <input type="submit" value=" evolve " '
+                  'name="evolve-app-zope.app.generations.demo"> </td>')
+        self.assert_(body.find(expect) > 0)
+
+        response = self.publish('/++etc++process/@@generations.html'
+                                '?evolve-app-zope.app.generations.demo=evolve',
+                                basic='globalmgr:globalmgrpw')
+        body = response.getBody()
+        body = ' '.join(body.split())
+        expect = ('zope.app.generations.demo</a> </td> '
+                  '<td>0</td> <td>3</td> <td>2</td> '
+                  '<td> <input type="submit" value=" evolve " '
+                  'name="evolve-app-zope.app.generations.demo"> </td>')
+        self.assert_(body.find(expect) > 0)
+
+        response = self.publish('/++etc++process/@@generations.html'
+                                '?evolve-app-zope.app.generations.demo=evolve',
+                                basic='globalmgr:globalmgrpw')
+        body = response.getBody()
+        body = ' '.join(body.split())
+        expect = ('zope.app.generations.demo</a> </td> '
+                  '<td>0</td> <td>3</td> <td>3</td> '
+                  '<td> <span>')
+        self.assert_(body.find(expect) > 0)
+
+        ztapi.unprovideUtility(ISchemaManager, appkey)
+
+
+
 def test_suite():
+    TestDatabaseSchema.layer = GenerationsLayer
     return unittest.TestSuite((
         DocTestSuite('zope.app.generations.browser.managers'),
         DocTestSuite('zope.app.generations.browser.managerdetails'),
+        unittest.makeSuite(TestDatabaseSchema),
         ))
 
 if __name__ == '__main__':



More information about the Zope3-Checkins mailing list