- Timestamp:
- 12 Jul 2017, 11:20:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/tests/test_browser.py
r14658 r14719 30 30 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 31 31 from waeup.kofa.students.accommodation import BedTicket 32 from waeup.kofa.browser.tests.test_pdf import samples_dir 32 33 from waeup.kofa.testing import FunctionalTestCase 33 34 from waeup.kofa.interfaces import ( … … 112 113 self.assertEqual(self.student['payments'].values()[3].p_level, 200) 113 114 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.