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

Last change on this file was 202, checked in by mylan, 18 years ago

Change sending notification e-mail from secureSend() to send().
Add to notification templates mail fields: To, From, Subject

File size: 1.4 KB
Line 
1from base import TestCase
2from config import nt_properties, s_properties
3
4class TestPropertiesToolConf(TestCase):
5
6    def afterSetUp(self):
7        self.ptool = self.portal.portal_properties
8
9    def testConfigurationNavtreePropertiesTool(self):
10        # Configuration navtree_properties
11        props = self.ptool.navtree_properties
12        for prop_id, prop_type, prop_value in nt_properties:
13           self.assertTrue(prop_id in props.propertyIds())
14           self.assertEqual(props.getPropertyType(prop_id), prop_type)
15           p_value = list(props.getProperty(prop_id))
16           prop_value.sort()
17           p_value.sort()
18           self.assertEqual([v for v in prop_value if v in p_value], prop_value)
19
20    def testConfigurationSitePropertiesTool(self):
21        # Configuration site_properties
22        props = self.ptool.site_properties
23        for prop_id, prop_type, prop_value in s_properties:
24           self.assertTrue(prop_id in props.propertyIds())
25           self.assertEqual(props.getPropertyType(prop_id), prop_type)
26           p_value = list(props.getProperty(prop_id))
27           prop_value.sort()
28           p_value.sort()
29           self.assertEqual([v for v in prop_value if v in p_value], prop_value)
30
31def test_suite():
32    from unittest import TestSuite, makeSuite
33    suite = TestSuite()
34    suite.addTest(makeSuite(TestPropertiesToolConf))
35    return suite
36
Note: See TracBrowser for help on using the repository browser.