Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testPluginActivated
def testEmptySearch
def testInexactStringSearch
def testBooleanSearch

Public Attributes

 mt
 md
 pas

Detailed Description

Definition at line 206 of file test_properties.py.


Member Function Documentation

Definition at line 207 of file test_properties.py.

00207 
00208     def afterSetUp(self):
00209         self.mt = getToolByName(self.portal, 'portal_membership')
00210         self.md = getToolByName(self.portal, 'portal_memberdata')
00211 
00212         # Create a new Member
00213         self.mt.addMember('member1', 'pw', ['Member'], [],
00214                      {'email': 'member1@host.com',
00215                       'title': 'Member #1'})
00216         member = self.mt.getMemberById('member1')
00217         self.failIf(member is None)
00218 
00219         self.mt.addMember('member2', 'pw', ['Member'], [],
00220                      {'email': 'user2@otherhost.com',
00221                       'fullname': 'User #2'})
00222         member = self.mt.getMemberById('member2')
00223         self.failIf(member is None)
00224 
00225         self.pas=getToolByName(self.portal, "acl_users")
00226         for plugin in self.pas.plugins.getAllPlugins('IUserEnumerationPlugin')['active']:
00227             if plugin!='mutable_properties':
00228                 self.pas.plugins.deactivatePlugin(IUserEnumerationPlugin, plugin)
00229 

Definition at line 261 of file test_properties.py.

00261 
00262     def testBooleanSearch(self):
00263         results=self.pas.searchUsers(visible_ids=True)
00264         results=[info['userid'] for info in results]
00265         self.assertEqual(results, [])
00266 
00267         results=self.pas.searchUsers(visible_ids=False)
00268         results=[info['userid'] for info in results]
00269         self.assertEqual(results, ['member1', 'member2'])
00270 

Definition at line 235 of file test_properties.py.

00235 
00236     def testEmptySearch(self):
00237         results=self.pas.searchUsers()
00238         self.assertEqual(len(results), 2)
00239 

Definition at line 240 of file test_properties.py.

00240 
00241     def testInexactStringSearch(self):
00242         results=self.pas.searchUsers(email="something@somewhere.tld")
00243         self.assertEqual(results, ())
00244 
00245         results=self.pas.searchUsers(email="member1@host.com", exact_match=False)
00246         results=[info['userid'] for info in results]
00247         self.assertEqual(results, ['member1'])
00248 
00249         results=self.pas.searchUsers(email="@host.com", exact_match=False)
00250         results=[info['userid'] for info in results]
00251         self.assertEqual(results, ['member1'])
00252 
00253         results=self.pas.searchUsers(email="member1@host.com", exact_match=True)
00254         results=[info['userid'] for info in results]
00255         self.assertEqual(results, ['member1'])
00256 
00257         results=self.pas.searchUsers(email="@host.com", exact_match=True)
00258         results=[info['userid'] for info in results]
00259         self.assertEqual(results, [])
00260 

Definition at line 230 of file test_properties.py.

00230 
00231     def testPluginActivated(self):
00232         plugins = self.pas.plugins.getAllPlugins('IUserEnumerationPlugin')['active']
00233         self.assertEqual(plugins, ('mutable_properties',))
00234 


Member Data Documentation

Definition at line 209 of file test_properties.py.

Definition at line 208 of file test_properties.py.

Definition at line 224 of file test_properties.py.


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