Ignore:
Timestamp:
6 May 2020, 13:49:45 (5 years ago)
Author:
Henrik Bettermann
Message:

Add base data slip download button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py

    r15859 r16087  
    122122        IWorkflowInfo(self.student).fireTransition('pay_school_fee')
    123123        self.assertFalse(self.student.library)
     124
     125    def test_student_basedata_slip(self):
     126        IWorkflowState(self.student).setState('school fee paid')
     127        self.browser.open(self.login_path)
     128        self.browser.getControl(name="form.login").value = self.student_id
     129        self.browser.getControl(name="form.password").value = 'spwd'
     130        self.browser.getControl("Login").click()
     131        # Students can open base data slip
     132        # (no button available in base package)
     133        pdf_url = '%s/basedata_slip.pdf' % self.studycourse_path
     134        self.browser.open(pdf_url)
     135        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     136        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     137        path = os.path.join(samples_dir(), 'basedata_slip.pdf')
     138        open(path, 'wb').write(self.browser.contents)
     139        print "Sample PDF basedata_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.