Changeset 17917 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 7 Sep 2024, 15:38:05 (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r17898 r17917 3058 3058 print "Sample png file written to %s" % path 3059 3059 3060 def test_student_final_clearance(self): 3061 self.student.browsertest = True 3062 self.browser.open(self.login_path) 3063 self.browser.getControl(name="form.login").value = self.student_id 3064 self.browser.getControl(name="form.password").value = 'spwd' 3065 self.browser.getControl("Login").click() 3066 self.browser.open(self.student_path) 3067 self.browser.getLink("Upload final clearance routing slip").click() 3068 ctrl = self.browser.getControl(name='finalclearanceuploadedit') 3069 file_obj = open(SAMPLE_PDF, 'rb') 3070 file_ctrl = ctrl.mech_control 3071 file_ctrl.add_file(file_obj, filename='routing_slip.pdf') 3072 self.browser.getControl( 3073 name='upload_finalclearanceuploadedit').click() 3074 self.assertTrue( 3075 'href="http://localhost/app/students/K1000000/routingslip.pdf"' 3076 in self.browser.contents) 3077 self.assertTrue( 3078 'File routingslip.pdf uploaded' in self.browser.contents) 3079 self.browser.getLink("Download Final Clearance Document").click() 3080 self.assertEqual(self.browser.headers['Status'], '200 Ok') 3081 self.assertEqual(self.browser.headers['Content-Type'], 3082 'application/pdf') 3083 path = os.path.join(samples_dir(), 'final_clearance_slip.pdf') 3084 open(path, 'wb').write(self.browser.contents) 3085 print "Sample PDF final_clearance_slip.pdf written to %s" % path 3086 return 3087 3060 3088 def test_student_course_registration(self): 3061 3089 # Student cant login if their password is not set
Note: See TracChangeset for help on using the changeset viewer.