Changeset 8118 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 12 Apr 2012, 06:27:43 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8116 r8118 534 534 '<a target="image" href="birth_certificate">' 535 535 in self.browser.contents) 536 # Managers can open the pdf slip537 self.browser.open(self.clearance_path)538 self.browser.getLink("slip").click()539 self.assertEqual(self.browser.headers['Status'], '200 Ok')540 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')541 536 # Browsing the link shows a real image 542 537 self.browser.open('birth_certificate') … … 623 618 '<img align="middle" height="125px" src="passport.jpg" />' 624 619 in self.browser.contents) 625 # The clearance slip can't be opened because it requires a proper626 # passport jpg file.627 self.browser.open(self.student_path + '/clearance.pdf')628 self.assertEqual(self.browser.headers['Status'], '200 Ok')629 self.assertTrue('Error in image file' in self.browser.contents)630 620 # We remove the passport file again 631 621 self.browser.open(self.manage_student_path) … … 1175 1165 # and go back to the edit form 1176 1166 self.browser.getLink("Edit").click() 1167 # Students can upload documents 1168 ctrl = self.browser.getControl(name='birthcertificateupload') 1169 file_obj = open( 1170 os.path.join(os.path.dirname(__file__), 'test_image.jpg'),'rb') 1171 file_ctrl = ctrl.mech_control 1172 file_ctrl.add_file(file_obj, filename='my_birth_certificate.jpg') 1173 self.browser.getControl( 1174 name='upload_birthcertificateupload').click() 1175 self.assertTrue( 1176 '<a target="image" href="birth_certificate">Birth Certificate Scan</a>' 1177 in self.browser.contents) 1178 # Students can open clearance slip 1179 self.browser.getLink("View").click() 1180 self.browser.getLink("Download clearance slip").click() 1181 print self.browser.contents 1182 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1183 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 1184 # Students can request clearance 1177 1185 self.browser.getControl("Save and request clearance").click() 1178 1179 1186 self.browser.getControl(name="ac_series").value = self.existing_clrseries 1180 1187 self.browser.getControl(name="ac_number").value = self.existing_clrnumber
Note: See TracChangeset for help on using the changeset viewer.