Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PlonePAS.tests.test_caching.BasicOpsTestCase Class Reference
Inheritance diagram for PlonePAS.tests.test_caching.BasicOpsTestCase:
Inheritance graph
[legend]
Collaboration diagram for PlonePAS.tests.test_caching.BasicOpsTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def createUser
def test_getUser_is_cached

Public Attributes

 acl_users

Detailed Description

Definition at line 52 of file test_caching.py.


Member Function Documentation

Definition at line 54 of file test_caching.py.

00054 
00055     def afterSetUp(self):
00056         self.loginAsPortalOwner()
00057         self.acl_users = self.portal.acl_users
00058         self.acl_users.ZCacheable_setManagerId('RAMCache')

Here is the call graph for this function:

def PlonePAS.tests.test_caching.BasicOpsTestCase.createUser (   self,
  name = "created_user",
  password = "secret",
  roles = [],
  groups = [],
  domains = () 
)

Definition at line 60 of file test_caching.py.

00060 
00061                    roles=[], groups=[], domains=()):
00062         self.acl_users.userFolderAddUser(
00063             name,
00064             password,
00065             roles = roles,
00066             groups = groups,
00067             domains = domains,
00068             )

Here is the caller graph for this function:

Definition at line 69 of file test_caching.py.

00069 
00070     def test_getUser_is_cached(self):
00071         # monitor the caching method
00072         collector = CollectResultsWrapper(self.acl_users.aq_base.__class__,
00073                                           'ZCacheable_get')
00074 
00075         self.assertEquals(collector.results, [])
00076         # creating a user already populates the cache, but it also looks
00077         # the user up, so we must have got only misses so far
00078         self.createUser()
00079         self.assertEquals(collector.results, [None] * len(collector.results))
00080         # creating a user does not necessarily insert a cache entry,
00081         # so retrieve the user twice to test caching.
00082         u = self.acl_users.getUser("created_user")
00083         u = self.acl_users.getUser("created_user")
00084         self.assertEquals(id(collector.results[-1]), id(u.aq_base),
00085                           "%r is not %r" % (collector.results[-1],
00086                                             u.aq_base))

Here is the call graph for this function:


Member Data Documentation

Definition at line 56 of file test_caching.py.


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