Changeset 7188
- Timestamp:
- 25 Nov 2011, 06:54:08 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
r7186 r7188 77 77 class AcademicsOfficer(grok.Role): 78 78 grok.name('waeup.AcademicsOfficer') 79 grok.title(u'Academics Offi ver (view only)')79 grok.title(u'Academics Officer (view only)') 80 80 grok.permissions('waeup.viewAcademics') 81 81 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7158 r7188 1 ##2 ## test_browser.py3 ## Login : <uli@pu.smp.net>4 ## Started on Tue Mar 29 11:31:11 2011 Uli Fouquet5 1 ## $Id$ 6 2 ## … … 42 38 from waeup.sirp.university.department import Department 43 39 from waeup.sirp.interfaces import IUserAccount 40 from waeup.sirp.authentication import LocalRoleSetEvent 44 41 from waeup.sirp.hostels.hostel import Hostel, Bed, NOT_OCCUPIED 45 42 … … 647 644 # Create clearance officer 648 645 self.app['users'].addUser('mrclear', 'mrclearsecret') 646 # Clearance officers need to get the StudentsOfficer site role 649 647 prmglobal = IPrincipalRoleManager(self.app) 650 648 prmglobal.assignRoleToPrincipal('waeup.StudentsOfficer', 'mrclear') 651 prmlocal = IPrincipalRoleManager(self.app['faculties']['fac1']['dep1']) 649 # Assign local ClearanceOfficer role 650 department = self.app['faculties']['fac1']['dep1'] 651 prmlocal = IPrincipalRoleManager(department) 652 652 prmlocal.assignRoleToPrincipal('waeup.local.ClearanceOfficer', 'mrclear') 653 653 IWorkflowInfo(self.student).fireTransition('admit') … … 659 659 self.browser.getControl("Login").click() 660 660 self.assertTrue('You logged in' in self.browser.contents) 661 # CO can see his roles 662 self.browser.getLink("My Roles").click() 663 self.assertMatches( 664 '...<div>Academics Officer (view only)</div>...', 665 self.browser.contents) 666 self.assertMatches( 667 '...<div>Students Officer (view only)</div>...', 668 self.browser.contents) 669 # But not his local role ... 670 self.assertFalse('Clearance Officer' in self.browser.contents) 671 # ... because we forgot to notify the department that the local role 672 # has changed 673 notify(LocalRoleSetEvent( 674 department, 'waeup.local.ClearanceOfficer', 'mrclear', granted=True)) 675 self.browser.open('http://localhost/app/users/mrclear/my_roles') 676 self.assertTrue('Clearance Officer' in self.browser.contents) 677 self.assertMatches( 678 '...<a href="http://localhost/app/faculties/fac1/dep1">...', 679 self.browser.contents) 680 # CO can view the student 661 681 self.browser.open(self.clearance_student_path) 662 682 self.assertEqual(self.browser.headers['Status'], '200 Ok') 663 683 self.assertEqual(self.browser.url, self.clearance_student_path) 664 # Only in state clearance requested the codoes see the 'Clear' button684 # Only in state clearance requested the CO does see the 'Clear' button 665 685 self.assertFalse('Clear student' in self.browser.contents) 666 686 IWorkflowInfo(self.student).fireTransition('request_clearance') … … 681 701 self.assertTrue('State: <span>clearance started</span>' 682 702 in self.browser.contents) 683 # The clearance officercan't clear students if not in state703 # The CO can't clear students if not in state 684 704 # clearance requested 685 705 self.browser.open(self.student_path + '/clear')
Note: See TracChangeset for help on using the changeset viewer.