source: products/qPingTool/branches/plone-3.1/tests/base.py

Last change on this file was 197, checked in by crchemist, 18 years ago

column view in configlet for content types in Plone-2.1 added

File size: 1.4 KB
Line 
1from Products.PloneTestCase import PloneTestCase as PloneTestCase
2
3from Products.CMFCore.utils import getToolByName
4from Products.Five.testbrowser import Browser
5
6from Products.qPingTool import PingTool
7from Products.qPingTool.config import *
8
9PRODUCTS = ['qPingTool', 'Quills']
10
11map(PloneTestCase.installProduct, ('qPingTool', 'XMLRPCMethod', 'Quills'))
12
13PloneTestCase.setupPloneSite(products=PRODUCTS)
14
15class TestCase(PloneTestCase.PloneTestCase):
16    """Base class used for test cases
17    """
18
19class FunctionalTestCase(PloneTestCase.FunctionalTestCase):
20    """Test case class used for functional (doc-)tests
21    """
22
23    def afterSetUp(self):
24        super(FunctionalTestCase, self).afterSetUp()
25
26        self.browser = Browser()
27
28        self.uf = self.portal.acl_users
29        self.uf.userFolderAddUser('root', 'secret', ['Manager'], [])
30
31        self.ptool = getToolByName(self.portal, 'portal_properties')
32        self.pitool = getToolByName(self.ptool, 'portal_pingtool')
33        self.site_props = self.ptool.site_properties
34
35    def loginAsManager(self, user='root', pwd='secret'):
36        """points the browser to the login screen and logs in as user root with Manager role."""
37        self.browser.open('http://nohost/plone/')
38        self.browser.getLink('Log in').click()
39        self.browser.getControl('Login Name').value = user
40        self.browser.getControl('Password').value = pwd
41        self.browser.getControl('Log in').click()
42
Note: See TracBrowser for help on using the repository browser.