Ignore:
Timestamp:
16 Aug 2023, 09:24:29 (17 months ago)
Author:
Henrik Bettermann
Message:

Implement medical examination form.

File:
1 edited

Legend:

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

    r17457 r17542  
    230230        self.assertTrue('Clearance has been requested'
    231231            in self.browser.contents)
    232         # Now student can export physical_clearance.slip
     232        # Now student can export physical_clearance_slip
    233233        self.app['configuration'].name = u'University of Benin'
    234234        self.student.physical_clearance_date = u'January 5th, 2015'
     
    240240        open(path, 'wb').write(self.browser.contents)
    241241        print "Sample PDF clearance_invitation_slip.pdf written to %s" % path
     242
     243    def test_medical_examination_slip(self):
     244        # Student can export medical_examination_slip
     245        self.app['configuration']['2004'].medical_clearance_fee = 1000.0
     246        self.app['configuration'].name = u'University of Benin'
     247        IWorkflowState(self.student).setState('cleared')
     248        self.student.perm_address = u'My Address in Nigeria'
     249        self.student.physical_clearance_date = u'January 5th, 2015'
     250        self.browser.open(self.login_path)
     251        self.browser.getControl(name="form.login").value = self.student_id
     252        self.browser.getControl(name="form.password").value = 'spwd'
     253        self.browser.getControl("Login").click()
     254        self.browser.open(self.clearance_path)
     255        self.browser.getLink("Download medical examination slip").click()
     256        self.assertTrue('Please pay medical clearance fee first' in
     257            self.browser.contents)
     258        self.browser.open(self.payments_path)
     259        self.browser.getLink("Add current session payment ticket").click()
     260        self.browser.getControl(name="form.p_category").value = ['medical_clearance']
     261        self.browser.getControl("Create ticket").click()
     262        p_ticket = self.student['payments'].values()[0]
     263        p_ticket.approveStudentPayment()
     264        self.browser.open(self.clearance_path)
     265        self.browser.getLink("Download medical examination slip").click()
     266        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     267        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     268        path = os.path.join(samples_dir(), 'medical_examination_slip.pdf')
     269        open(path, 'wb').write(self.browser.contents)
     270        print "Sample PDF medical_examination_slip.pdf written to %s" % path
     271
    242272        # Students can open the personal edit page and see the parent_email field.
    243273        self.browser.open(self.student_path + '/edit_personal')
Note: See TracChangeset for help on using the changeset viewer.