Changeset 13723 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 23 Feb 2016, 17:36:46 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r13621 r13723 194 194 self.browser.open(self.student_path + '/edit_personal') 195 195 self.assertTrue('parent_email' in self.browser.contents) 196 197 def test_examination_schedule_slip(self): 198 self.student.flash_notice = u'My Examination Date' 199 self.browser.open(self.login_path) 200 self.browser.getControl(name="form.login").value = self.student_id 201 self.browser.getControl(name="form.password").value = 'spwd' 202 self.browser.getControl("Login").click() 203 self.browser.getLink("Download examination schedule slip").click() 204 self.assertEqual(self.browser.headers['Status'], '200 Ok') 205 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 206 path = os.path.join(samples_dir(), 'examination_schedule_slip.pdf') 207 open(path, 'wb').write(self.browser.contents) 208 print "Sample PDF examination_schedule_slip.pdf written to %s" % path 209 # If flash_notive does not contain exam' the button does not show up. 210 self.student.flash_notice = u'anything' 211 self.browser.open(self.student_path) 212 self.assertFalse('examination schedule slip' in self.browser.contents) 196 213 197 214 def test_manage_payments(self): … … 929 946 self.browser.getControl(name="form.p_category").value = ['bed_allocation'] 930 947 self.browser.getControl("Create ticket").click() 931 ctrl = self.browser.getControl(name='val_id')932 value = ctrl.options[0]933 self.browser.getLink(value).click()934 948 p_ticket = self.student['payments'].values()[0] 935 949 p_ticket.approveStudentPayment() … … 1029 1043 self.assertMatches('...Payment ticket created...', 1030 1044 self.browser.contents) 1031 ctrl = self.browser.getControl(name='val_id')1032 value = ctrl.options[0]1033 1045 # Maintennace fee is taken from the hostel object. 1034 self.assertEqual(self.student['payments'] [value].amount_auth, 876.0)1046 self.assertEqual(self.student['payments'].values()[1].amount_auth, 876.0) 1035 1047 # If the hostel's maintenance fee isn't set, the fee is 1036 1048 # taken from the session configuration object. … … 1039 1051 self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] 1040 1052 self.browser.getControl("Create ticket").click() 1041 ctrl = self.browser.getControl(name='val_id') 1042 value = ctrl.options[1] 1043 self.assertEqual(self.student['payments'][value].amount_auth, 987.0) 1053 self.assertEqual(self.student['payments'].values()[2].amount_auth, 987.0) 1044 1054 return
Note: See TracChangeset for help on using the changeset viewer.