[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_
- use super() in setUp
Philipp von Weitershausen
philikon at philikon.de
Wed May 19 06:45:25 EDT 2004
Log message for revision 24821:
- use super() in setUp
- get rid of bogus tearDown
- whitespace cleanup
-=-
Modified: Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py 2004-05-19 10:37:59 UTC (rev 24820)
+++ Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py 2004-05-19 10:45:25 UTC (rev 24821)
@@ -13,8 +13,7 @@
##############################################################################
"""Functional Tests for ContentWorkflowsManager
- $Id$
-
+$Id$
"""
import unittest
import re
@@ -35,7 +34,7 @@
class Test(BrowserTestCase):
def setUp(self):
- BrowserTestCase.setUp(self)
+ super(Test, self).setUp()
self.basepath = '/++etc++site/default'
root = self.getRootFolder()
@@ -49,13 +48,13 @@
response = self.publish(
self.basepath + '/contents.html',
basic='mgr:mgrpw')
-
+
self.assertEqual(response.getStatus(), 200)
-
+
expr = 'zope.app.browser.add.ContentWorkflowsManager.f([0-9]*)'
m = re.search(expr, response.getBody())
type_name = m.group(0)
-
+
response = self.publish(
self.basepath + '/contents.html',
basic='mgr:mgrpw',
@@ -69,17 +68,12 @@
'cwm', IContentWorkflowsManager, self.basepath+'/mgr')
pd_id = rm.addRegistration(registration)
zapi.traverse(rm, pd_id).status = ActiveStatus
-
- def tearDown(self):
- BrowserTestCase.tearDown(self)
-
-
def test_subscribe(self):
response = self.publish(
self.basepath + '/mgr/index.html',
basic='mgr:mgrpw')
-
+
self.assertEqual(response.getStatus(), 200)
body = ' '.join(response.getBody().split())
self.assert_(body.find("Subscription state: OFF") >= 0)
@@ -88,19 +82,19 @@
self.basepath + '/mgr/index.html',
basic='mgr:mgrpw',
form={'callSubscribe':'Subscribe'})
-
+
self.assertEqual(response.getStatus(), 200)
body = ' '.join(response.getBody().split())
self.assert_(body.find("Subscription state: ON") >= 0)
root = self.getRootFolder()
mgr = zapi.traverse(root, self.basepath+'/mgr')
self.assert_(mgr.isSubscribed())
-
+
def test_registry(self):
response = self.publish(
self.basepath + '/mgr/registry.html',
basic='mgr:mgrpw')
-
+
self.assertEqual(response.getStatus(), 200)
body = ' '.join(response.getBody().split())
self.assert_(body.find(
@@ -119,7 +113,7 @@
'field.name':['dummy-definition'],
'ADD':'Add'
})
-
+
self.assertEqual(response.getStatus(), 200)
root = self.getRootFolder()
mgr = zapi.traverse(root, self.basepath+'/mgr')
@@ -148,7 +142,6 @@
ifaces = mgr.getInterfacesForProcessName('dummy-definition')
self.assertEqual(len(ifaces),0)
-
def test_suite():
return unittest.makeSuite(Test)
Modified: Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py 2004-05-19 10:37:59 UTC (rev 24820)
+++ Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py 2004-05-19 10:45:25 UTC (rev 24821)
@@ -13,21 +13,19 @@
##############################################################################
"""Functional Tests for StatefulProcessDefinition
- $Id$
-
+$Id$
"""
import unittest
import re
from zope.app import zapi
from zope.app.tests.functional import BrowserTestCase
-
from zope.app.workflow.stateful.definition import StatefulProcessDefinition
class Test(BrowserTestCase):
def setUp(self):
- BrowserTestCase.setUp(self)
+ super(Test, self).setUp()
self.basepath = '/++etc++site/default'
response = self.publish(
self.basepath + '/contents.html',
@@ -45,11 +43,6 @@
form={'type_name': type_name,
'new_value': 'pd' })
-
- def tearDown(self):
- BrowserTestCase.tearDown(self)
-
-
def test_processdefinition(self):
response = self.publish(
self.basepath + '/pd/index.html',
More information about the Zope3-Checkins
mailing list