- Timestamp:
- 2 Nov 2019, 17:55:19 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/tests/test_browser.py
r14716 r15743 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 def test_student_clearance(self): 49 # Student cant login if their password is not set 50 IWorkflowInfo(self.student).fireTransition('admit') 51 self.browser.open(self.login_path) 52 self.browser.getControl(name="form.login").value = self.student_id 53 self.browser.getControl(name="form.password").value = 'spwd' 54 self.browser.getControl("Login").click() 55 self.assertMatches( 56 '...You logged in...', self.browser.contents) 57 # Admitted student can upload a passport picture 58 #self.browser.open(self.student_path + '/change_portrait') 59 #ctrl = self.browser.getControl(name='passportuploadedit') 60 #file_obj = open(SAMPLE_IMAGE, 'rb') 61 #file_ctrl = ctrl.mech_control 62 #file_ctrl.add_file(file_obj, filename='my_photo.jpg') 63 #self.browser.getControl( 64 # name='upload_passportuploadedit').click() 65 #elf.assertTrue( 66 # 'src="http://localhost/app/students/K1000000/passport.jpg"' 67 # in self.browser.contents) 68 ## Students can open admission letter 69 self.browser.getLink("Base Data").click() 70 self.browser.getLink("Download admission letter").click() 71 self.assertEqual(self.browser.headers['Status'], '200 Ok') 72 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 73 path = os.path.join(samples_dir(), 'admission_slip.pdf') 74 open(path, 'wb').write(self.browser.contents) 75 print "Sample PDF admission_slip.pdf written to %s" % path
Note: See TracChangeset for help on using the changeset viewer.