[Zope3-checkins] CVS: Zope3/src/zope/app/applicationcontrol/browser/ftests - test_zodbcontrol.py:1.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 23 10:52:04 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/applicationcontrol/browser/ftests
In directory cvs.zope.org:/tmp/cvs-serv1766/src/zope/app/applicationcontrol/browser/ftests

Added Files:
	test_zodbcontrol.py 
Log Message:


Provide a good functional test for the ZODB control.



Remove useless adapter.




=== Added File Zope3/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""ZODB Control Tests

$Id: test_zodbcontrol.py,v 1.1 2004/03/23 15:52:02 srichter Exp $
"""
import unittest

from zope.testing.functional import BrowserTestCase


class ZODBControlTest(BrowserTestCase):

    def testZODBControlOverview(self):
        response = self.publish('/++etc++process/@@ZODBControl.html',
                                basic='mgr:mgrpw',
                                form={'days': u'3'})
        body = response.getBody()
        self.assert_('value="3"' in body)
        self.assert_('<em>Demo Storage</em>' in body)
        self.assert_('<em>100 Bytes</em>' in body)
        
    # XXX: Disabled test, since we cannot packe demo storages.
    def _testPack(self):
        response = self.publish('/++etc++process/@@ZODBControl.html',
                                basic='mgr:mgrpw',
                                form={'days': u'0',
                                      'PACK': u'Pack'})
        body = response.getBody()
        self.assert_('value="0"' in body)
        self.assert_('<em>Demo Storage</em>' in body)
        self.assert_('<em>100 Bytes</em>' in body)
        self.assert_('ZODB successfully packed.' in body)
        



def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(ZODBControlTest))
    return suite

if __name__=='__main__':
    unittest.main(defaultTest='test_suite')




More information about the Zope3-Checkins mailing list