Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
CMFDefault.tests.test_PropertiesTool.PropertiesToolTests Class Reference
Inheritance diagram for CMFDefault.tests.test_PropertiesTool.PropertiesToolTests:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.tests.test_PropertiesTool.PropertiesToolTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test_z2interfaces
def test_z3interfaces
def test_editProperties

Public Attributes

 site

Private Member Functions

def _makeOne

Detailed Description

Definition at line 51 of file test_PropertiesTool.py.


Member Function Documentation

def CMFDefault.tests.test_PropertiesTool.PropertiesToolTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 53 of file test_PropertiesTool.py.

00053 
00054     def _makeOne(self, *args, **kw):
00055         from Products.CMFDefault.PropertiesTool import PropertiesTool
00056 
00057         return PropertiesTool(*args, **kw)

Definition at line 58 of file test_PropertiesTool.py.

00058 
00059     def setUp(self):
00060         SecurityTest.setUp(self)
00061         self.site = PropertiedDummySite('site')
00062         sm = getSiteManager()
00063         sm.registerUtility(self.site, ISiteRoot)
00064         self.site._setObject('portal_properties', self._makeOne())
00065         sm.registerUtility(self.site.portal_properties, IPropertiesTool)
00066         self.site._setObject('MailHost', MailHost('MailHost'))
00067         sm.registerUtility(self.site.MailHost, IMailHost)

Definition at line 68 of file test_PropertiesTool.py.

00068 
00069     def tearDown(self):
00070         cleanUp()
00071         SecurityTest.tearDown(self)

Here is the call graph for this function:

Definition at line 87 of file test_PropertiesTool.py.

00087 
00088     def test_editProperties(self):
00089         # https://bugs.launchpad.net/zope-cmf/+bug/174246
00090         # PropertiesTool.editProperties fails with traceback due to
00091         # faulty invocation of the site's manage_changeProperties method
00092         props = { 'email_from_name' : 'Test Admin'
00093                 , 'email_from_address' : 'test@example.com'
00094                 , 'description' : 'Test MailHost Description'
00095                 , 'title' : 'Test MailHost'
00096                 , 'smtp_server' : 'mail.example.com'
00097                 , 'validate_email' : True
00098                 , 'email_charset' : 'iso-8859-15'
00099                 , 'default_charset' : 'iso-8859-1'
00100                 , 'enable_permalink' : True
00101                 }
00102         tool = getUtility(IPropertiesTool)
00103         tool.editProperties(props)
00104 
00105         site_prop = self.site.getProperty
00106         self.assertEquals(getUtility(IMailHost).smtp_host, 'mail.example.com')
00107         self.assertEquals(site_prop('email_from_name'), 'Test Admin')
00108         self.assertEquals(site_prop('email_from_address'), 'test@example.com')
00109         self.assertEquals(site_prop('description'), 'Test MailHost Description')
00110         self.assertEquals(site_prop('title'), 'Test MailHost')
00111         self.assertEquals(site_prop('validate_email'), True)
00112         self.assertEquals(site_prop('email_charset'), 'iso-8859-15')
00113         self.assertEquals(site_prop('default_charset'), 'iso-8859-1')
00114         self.assertEquals(site_prop('enable_permalink'), True)
00115 

Definition at line 72 of file test_PropertiesTool.py.

00072 
00073     def test_z2interfaces(self):
00074         from Interface.Verify import verifyClass
00075         from Products.CMFCore.interfaces.portal_properties \
00076                 import portal_properties as IPropertiesTool
00077         from Products.CMFDefault.PropertiesTool import PropertiesTool
00078 
00079         verifyClass(IPropertiesTool, PropertiesTool)

Definition at line 80 of file test_PropertiesTool.py.

00080 
00081     def test_z3interfaces(self):
00082         from zope.interface.verify import verifyClass
00083         from Products.CMFCore.interfaces import IPropertiesTool
00084         from Products.CMFDefault.PropertiesTool import PropertiesTool
00085 
00086         verifyClass(IPropertiesTool, PropertiesTool)


Member Data Documentation

Definition at line 60 of file test_PropertiesTool.py.


The documentation for this class was generated from the following file: