Changeset 10249


Ignore:
Timestamp:
29 May 2013, 07:01:59 (12 years ago)
Author:
Henrik Bettermann
Message:

Add test which ensures that a bursary officers can do what she is supposed to do.

File:
1 edited

Legend:

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

    r10248 r10249  
    28852885        self.browser.getLink("Export student data").click()
    28862886        self.browser.getControl("Configure new export").click()
    2887         # Only the bursary exporter us available ot this level
    2888         #self.assertFalse('<option value="students">' in self.browser.contents)
    2889         #self.assertTrue('<option value="bursary">' in self.browser.contents)
    28902887        self.browser.getControl(name="exporter").value = ['bursary']
    28912888        self.browser.getControl(name="session").value = ['2004']
     
    31253122            '- discarded: job_id=%s' % job_id in logcontent
    31263123            )
     3124
     3125    def test_export_bursary_officers(self):
     3126        # Create bursary officer
     3127        self.app['users'].addUser('mrbursary', 'mrbursarysecret')
     3128        self.app['users']['mrbursary'].email = 'mrbursary@foo.ng'
     3129        self.app['users']['mrbursary'].title = 'Carlo Pitter'
     3130        prmglobal = IPrincipalRoleManager(self.app)
     3131        prmglobal.assignRoleToPrincipal('waeup.BursaryOfficer', 'mrbursary')
     3132        # Login as bursary officer
     3133        self.browser.open(self.login_path)
     3134        self.browser.getControl(name="form.login").value = 'mrbursary'
     3135        self.browser.getControl(name="form.password").value = 'mrbursarysecret'
     3136        self.browser.getControl("Login").click()
     3137        self.assertMatches('...You logged in...', self.browser.contents)
     3138        self.browser.getLink("Academics").click()
     3139        self.browser.getLink("Export student data").click()
     3140        self.browser.getControl("Configure new export").click()
     3141        # Only the bursary exporter is available for bursary officers
     3142        # not only at facultiescontainer level ...
     3143        self.assertFalse('<option value="students">' in self.browser.contents)
     3144        self.assertTrue('<option value="bursary">' in self.browser.contents)
     3145        self.browser.getControl(name="exporter").value = ['bursary']
     3146        self.browser.getControl(name="session").value = ['2004']
     3147        self.browser.getControl(name="level").value = ['100']
     3148        self.browser.getControl("Create CSV file").click()
     3149        self.assertTrue('Export started' in self.browser.contents)
     3150        # ... but also at other levels
     3151        self.browser.open('http://localhost/app/faculties/fac1/dep1')
     3152        self.browser.getLink("Export student data").click()
     3153        self.browser.getControl("Configure new export").click()
     3154        self.assertFalse('<option value="students">' in self.browser.contents)
     3155        self.assertTrue('<option value="bursary">' in self.browser.contents)
     3156
Note: See TracChangeset for help on using the changeset viewer.