- Timestamp:
- 24 Aug 2015, 20:57:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13219 r13227 29 29 from mechanize import LinkNotFoundError 30 30 from zc.async.testing import wait_for_result 31 from zope.securitypolicy.interfaces import IPrincipalRoleManager 31 32 from zope.event import notify 32 33 from zope.catalog.interfaces import ICatalog … … 438 439 439 440 def test_add_delete_applicants(self): 441 # Check the global role map first 442 role_manager = IPrincipalRoleManager(grok.getSite()) 443 principals = role_manager.getPrincipalsForRole('waeup.Applicant') 444 self.assertEqual(len(principals), 1) 445 self.assertEqual(principals[0][0], self.applicant.applicant_id) 440 446 # Managers can add and delete applicants 441 447 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 452 458 self.browser.getControl("Create application record").click() 453 459 self.assertTrue('Application initialized' in self.browser.contents) 460 # The global role map has been extended 461 role_manager = IPrincipalRoleManager(grok.getSite()) 462 principals = role_manager.getPrincipalsForRole('waeup.Applicant') 463 self.assertEqual(len(principals), 2) 454 464 self.browser.open(self.container_manage_path) 455 465 self.assertEqual(self.browser.headers['Status'], '200 Ok') 456 466 ctrl = self.browser.getControl(name='val_id') 457 467 value = ctrl.options[0] 468 self.assertEqual(principals[1][0].split('_')[1], value) 458 469 ctrl.getControl(value=value).selected = True 459 470 self.browser.getControl("Remove selected", index=0).click() 460 471 self.assertTrue('Successfully removed:' in self.browser.contents) 472 # The global role map has been reduced 473 role_manager = IPrincipalRoleManager(grok.getSite()) 474 principals = role_manager.getPrincipalsForRole('waeup.Applicant') 475 self.assertEqual(len(principals), 1) 461 476 self.browser.open(self.add_applicant_path) 462 477 self.browser.getControl(name="form.firstname").value = 'Albert'
Note: See TracChangeset for help on using the changeset viewer.