- Timestamp:
- 20 Oct 2019, 20:06:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py
r15563 r15696 31 31 from waeup.kofa.students.accommodation import BedTicket 32 32 from waeup.kofa.testing import FunctionalTestCase 33 from waeup.kofa.browser.tests.test_pdf import samples_dir 33 34 from waeup.kofa.interfaces import ( 34 35 IExtFileStore, IFileStoreNameChooser) … … 44 45 def test_dummytest(self): 45 46 return 47 48 49 class StudentUITests(StudentsFullSetup): 50 # Tests for Student class views and pages 51 52 layer = FunctionalLayer 53 54 def test_student_course_registration(self): 55 IWorkflowState(self.student).setState('school fee paid') 56 self.browser.open(self.login_path) 57 self.browser.getControl(name="form.login").value = self.student_id 58 self.browser.getControl(name="form.password").value = 'spwd' 59 self.browser.getControl("Login").click() 60 # Now students can add the current study level 61 self.browser.getLink("Study Course").click() 62 self.browser.getLink("Add course list").click() 63 self.assertMatches('...Add current level 100 (Year 1)...', 64 self.browser.contents) 65 self.browser.getControl("Create course list now").click() 66 # Students can open the pdf course registration slip 67 self.browser.open( 68 self.student_path + '/studycourse/100/course_registration_slip.pdf') 69 self.assertEqual(self.browser.headers['Status'], '200 Ok') 70 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 71 path = os.path.join(samples_dir(), 'course_registration_slip.pdf') 72 open(path, 'wb').write(self.browser.contents) 73 print "Sample PDF course_registration_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.