Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_basetest

Static Public Attributes

int caching = 0

Private Attributes

 _storage
 _instance

Detailed Description

Definition at line 60 of file test_aggregated_storage.py.


Member Function Documentation

Definition at line 64 of file test_aggregated_storage.py.

00064 
00065     def afterSetUp(self):
00066         self._storage = AggregatedStorage(caching=self.caching)
00067         self._storage.registerAggregator('whole_name', 'get_name')
00068         self._storage.registerDisaggregator('whole_name', 'set_name')
00069 
00070         schema = Schema( (StringField('whole_name', storage=self._storage),
00071                          ))
00072 
00073         # to enable overrideDiscussionFor
00074         self.setRoles(['Manager'])        
00075 
00076         self._instance = mkDummyInContext(klass=Dummy, oid='dummy',
00077                                           context=self.portal, schema=schema)

Definition at line 78 of file test_aggregated_storage.py.

00078 
00079     def test_basetest(self):
00080         field = self._instance.Schema()['whole_name']
00081 
00082         self.assertEqual(field.get(self._instance).strip(), '')
00083         field.set(self._instance, 'Donald Duck')
00084         self.assertEqual(self._instance.firstname, 'Donald')
00085         self.assertEqual(self._instance.lastname, 'Duck')
00086         self.assertEqual(field.get(self._instance).strip(), 'Donald Duck')
00087 
00088         self._instance.firstname = 'Daniel'
00089         self._instance.lastname = 'Dosentrieb'
00090         self.assertEqual(field.get(self._instance).strip(), 'Daniel Dosentrieb')
00091 
00092         field.set(self._instance, 'Bingo Gringo')
00093         self.assertEqual(self._instance.firstname, 'Bingo')
00094         self.assertEqual(self._instance.lastname, 'Gringo')
00095 

Here is the call graph for this function:


Member Data Documentation

Definition at line 75 of file test_aggregated_storage.py.

Definition at line 65 of file test_aggregated_storage.py.


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