Ignore:
Timestamp:
12 Jul 2017, 11:20:16 (7 years ago)
Author:
Henrik Bettermann
Message:

Add signature fields.

File:
1 edited

Legend:

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

    r14658 r14719  
    3030from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    3131from waeup.kofa.students.accommodation import BedTicket
     32from waeup.kofa.browser.tests.test_pdf import samples_dir
    3233from waeup.kofa.testing import FunctionalTestCase
    3334from waeup.kofa.interfaces import (
     
    112113        self.assertEqual(self.student['payments'].values()[3].p_level, 200)
    113114        return
     115
     116    def test_registration_pdf_slips(self):
     117        # Student cant login if their password is not set
     118        IWorkflowState(self.student).setState('school fee paid')
     119        self.browser.open(self.login_path)
     120        self.browser.getControl(name="form.login").value = self.student_id
     121        self.browser.getControl(name="form.password").value = 'spwd'
     122        self.browser.getControl("Login").click()
     123        self.browser.getLink("Study Course").click()
     124        self.browser.getLink("Add course list").click()
     125        self.assertMatches('...Add current level 100 (Year 1)...',
     126                           self.browser.contents)
     127        self.browser.getControl("Create course list now").click()
     128        # A level with one course ticket was created
     129        self.browser.getLink("100").click()
     130        self.browser.getLink("Download course registration slip").click()
     131        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     132        self.assertEqual(self.browser.headers['Content-Type'],
     133                         'application/pdf')
     134        path = os.path.join(samples_dir(), 'course_registration_slip.pdf')
     135        open(path, 'wb').write(self.browser.contents)
     136        print "Sample PDF course_registration_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.