Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
Archetypes.tests.test_sitepolicy.SitePolicyTests Class Reference
Inheritance diagram for Archetypes.tests.test_sitepolicy.SitePolicyTests:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_sitepolicy.SitePolicyTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_availabledemotypes
 def test_new( self ):

catalog should have one entry, for index_html or frontpage

and another for Members

self.assertEqual( len( self.portal.portal_catalog ), 2 )
def test_creationdemotypes
def test_ComplexTypeGetSize
def test_SimpleFolderGetSize
def test_addComplexTypeCtor

Static Public Attributes

list demo_types

Detailed Description

Definition at line 35 of file test_sitepolicy.py.


Member Function Documentation

Definition at line 97 of file test_sitepolicy.py.

00097 
00098     def test_addComplexTypeCtor(self):
00099         addComplexType = generateCtor('ComplexType', complextype)
00100         id = addComplexType(self.folder, id='complex_type',
00101                             textfield='Bla', integerfield=1,
00102                             stringfield='A String')
00103         obj = getattr(self.folder, id)
00104         self.assertEqual(obj.getTextfield(), 'Bla')
00105         self.assertEqual(obj.getStringfield(), 'A String')
00106         self.assertEqual(obj.getIntegerfield(), 1)
00107 

Here is the call graph for this function:

def test_new( self ):

catalog should have one entry, for index_html or frontpage

and another for Members

self.assertEqual( len( self.portal.portal_catalog ), 2 )

Definition at line 46 of file test_sitepolicy.py.

00046 
00047     def test_availabledemotypes(self):
00048         portal_types = self.portal.portal_types.listContentTypes()
00049         for t in self.demo_types:
00050             self.failUnless(t in portal_types,
00051                             "%s not available in portal_types." % t)

Definition at line 60 of file test_sitepolicy.py.

00060 
00061     def test_ComplexTypeGetSize(self):
00062         content = makeContent(self.folder, portal_type='ComplexType', id='ct')
00063         size = content.get_size()
00064         now = DateTime()
00065         content.setExpirationDate(now)
00066         # subtract 4 because an empty DateTime field has this size
00067         new_size = size + len(str(now)) - 4
00068         self.assertEqual(new_size, content.get_size())
00069         content.setEffectiveDate(now)
00070         new_size = new_size + len(str(now)) - 4
00071         self.assertEqual(new_size, content.get_size())
00072         content.setIntegerfield(100)
00073         new_size = new_size -1
00074         self.assertEqual(new_size, content.get_size())
00075         content.setIntegerfield(1)
00076         new_size = new_size - 2
00077         self.assertEqual(new_size, content.get_size())
00078         text = 'Bla bla bla'
00079         content.setTextfield(text)
00080         new_size = new_size + len(text)
00081         self.assertEqual(new_size, content.get_size())

Here is the call graph for this function:

Definition at line 52 of file test_sitepolicy.py.

00052 
00053     def test_creationdemotypes(self):
00054         for t in self.demo_types:
00055             content = makeContent(self.folder, portal_type=t, id=t)
00056             self.failUnless(t in self.folder.contentIds())
00057             self.failUnless(not isinstance(content, DefaultDublinCoreImpl))

Here is the call graph for this function:

Definition at line 82 of file test_sitepolicy.py.

00082 
00083     def test_SimpleFolderGetSize(self):
00084         content = makeContent(self.folder, portal_type='SimpleFolder', id='sf')
00085         size = content.get_size()
00086         now = DateTime()
00087         content.setExpirationDate(now)
00088         new_size = size + len(str(now)) - 4
00089         self.assertEqual(new_size, content.get_size())
00090         content.setEffectiveDate(now)
00091         new_size = new_size + len(str(now)) - 4
00092         self.assertEqual(new_size, content.get_size())
00093         text = 'Bla bla bla'
00094         content.setTitle(text)
00095         new_size = new_size + len(text)
00096         self.assertEqual(new_size, content.get_size())

Here is the call graph for this function:


Member Data Documentation

Initial value:
['DDocument', 'SimpleType', 'SimpleFolder',
                  'Fact', 'ComplexType']

Definition at line 36 of file test_sitepolicy.py.


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