Ignore:
Timestamp:
9 Feb 2018, 09:17:58 (7 years ago)
Author:
Henrik Bettermann
Message:

Display applicant id and error messages in flash message box if student creation has failed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r14366 r14949  
    536536        self.assertEqual(self.applicantscontainer.counts[1], 0)
    537537        return
     538
     539    def init_officer(self):
     540        # Create application officer
     541        self.app['users'].addUser('mrappl', 'mrapplsecret')
     542        self.app['users']['mrappl'].email = 'mrappl@foo.ng'
     543        self.app['users']['mrappl'].title = 'Carlo Pitter'
     544        prmglobal = IPrincipalRoleManager(self.app)
     545        prmglobal.assignRoleToPrincipal('waeup.ApplicationsManager', 'mrappl')
     546        # Login as officer
     547        self.browser.open(self.login_path)
     548        self.browser.getControl(name="form.login").value = 'mrappl'
     549        self.browser.getControl(name="form.password").value = 'mrapplsecret'
     550        self.browser.getControl("Login").click()
     551
     552    def test_student_creation_permission(self):
     553        self.init_officer()
     554        self.browser.open(self.container_path + '/manage')
     555        self.browser.getControl("Create students").click()
     556        self.assertTrue('You don\'t have permission to create student records'
     557            in self.browser.contents)
     558        prmglobal = IPrincipalRoleManager(self.app)
     559        prmglobal.assignRoleToPrincipal('waeup.StudentsCreator', 'mrappl')
     560        self.browser.getControl("Create students").click()
     561        self.assertTrue('No applicant selected' in self.browser.contents)
     562
    538563
    539564class ApplicantUITests(ApplicantsFullSetup):
Note: See TracChangeset for help on using the changeset viewer.