source: products/quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_setup.py

Last change on this file was 833, checked in by crchemist, 17 years ago

Fix IE 7 width issues.

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1import unittest
2from Products.CMFCore.utils import getToolByName
3
4from quintagroup.ploneformgen.readonlystringfield.tests.base import \
5    ReadOnlyStringFieldTestCase
6
7
8class TestSetup(ReadOnlyStringFieldTestCase):
9   
10    def afterSetUp(self):
11        self.loginAsPortalOwner()
12   
13    def test_installerTool(self):
14        tool = getToolByName(self.portal, 'portal_quickinstaller')
15        self.failUnless(tool.isProductInstalled('PloneFormGen'),
16            'PloneFormGen product is not installed.')
17   
18    def test_factoryTool(self):
19        tool = getToolByName(self.portal, 'portal_factory')
20        self.failUnless('FormReadonlyStringField' in tool._factory_types.keys(),
21            'FormReadonlyStringField type is not in portal_factory tool.')
22   
23    def test_typesTool(self):
24        tool = getToolByName(self.portal, 'portal_types')
25        self.failUnless('FormReadonlyStringField' in tool.objectIds(),
26            'FormReadonlyStringField type is not in portal_types tool.')
27   
28    def test_propertiesTool(self):
29        tool = getToolByName(self.portal, 'portal_properties')
30        navtree = tool.navtree_properties
31        self.failUnless('FormReadonlyStringField' in navtree.metaTypesNotToList,
32            'FormReadonlyStringField is not in metaTypesNotToList property.')
33        site = tool.site_properties
34        self.failUnless('FormReadonlyStringField' in site.types_not_searched,
35            'FormReadonlyStringField is not in types_not_searched property.')
36   
37    def test_skinsTool(self):
38        tool = getToolByName(self.portal, 'portal_skins')
39        self.failUnless('readonlystringfield' in tool.objectIds(),
40            'There is no readonlystringfield folder in portal_skins.')
41        for path_id, path in tool._getSelections().items():
42            layers = [l.strip() for l in path.split(',')]
43            self.failUnless('readonlystringfield' in layers,
44                'readonlystringfield layer is not registered for %s.' % path_id)
45
46def test_suite():
47    suite = unittest.TestSuite()
48    suite.addTest(unittest.makeSuite(TestSetup))
49    return suite
Note: See TracBrowser for help on using the repository browser.