source: products/qPingTool/trunk/tests/tests.py @ 2111

Last change on this file since 2111 was 205, checked in by chervol, 18 years ago

fixed labels in configlet

File size: 1.2 KB
Line 
1import unittest
2from zope.testing import doctestunit
3from Testing.ZopeTestCase import FunctionalDocFileSuite as FileSuite
4
5from zope.app.tests.placelesssetup import setUp, tearDown
6from Products.PloneTestCase import PloneTestCase as PloneTestCase
7
8class FunctionalTestCase(PloneTestCase.FunctionalTestCase):
9    """Test case class used for functional (doc-)tests
10    """
11
12    def afterSetUp(self):
13        super(FunctionalTestCase, self).afterSetUp()
14
15        self.uf = self.portal.acl_users
16        self.uf.userFolderAddUser('root', 'secret', ['Manager'], [])
17
18    def loginAsManager(self, user='root', pwd='secret'):
19        """points the browser to the login screen and logs in as user root with Manager role."""
20        self.basic_auth = '%s:%s' % (user, pwd)
21        self.login('root')
22
23
24def test_suite():
25    return unittest.TestSuite([
26       
27        doctestunit.DocTestSuite(
28            module='Products.qPingTool.adapter',
29            setUp=setUp, tearDown=tearDown),
30       
31        FileSuite(
32            'browser.txt', package='Products.qPingTool.tests',
33            test_class=FunctionalTestCase,),
34
35        ])
36
37if __name__ == '__main__':
38    unittest.main(defaultTest='test_suite')
Note: See TracBrowser for help on using the repository browser.