Changeset 7248
- Timestamp:
- 1 Dec 2011, 13:01:24 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7240 r7248 1080 1080 for key in self.context.keys(): 1081 1081 ticket = self.context[key] 1082 if ticket.p_category == p_category and \ 1082 if ticket.p_state == 'paid' and\ 1083 ticket.p_category == p_category and \ 1083 1084 ticket.p_item == p_item and \ 1084 1085 ticket.p_session == p_session: 1085 1086 self.flash( 1086 'This payment ticket already exists.')1087 'This type of payment ticket exists and ticket has been paid.') 1087 1088 self.redirect(self.url(self.context)) 1088 1089 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7240 r7248 987 987 self.browser.contents) 988 988 989 # The same payment ticket(with same p_item, p_session and p_category)990 # can 't be added twice.989 # The same payment (with same p_item, p_session and p_category) 990 # can be initialized a second time if the former ticket is not yet paid. 991 991 self.browser.open(self.payments_student_path) 992 992 self.browser.getControl("Add online payment ticket").click() 993 993 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 994 994 self.browser.getControl("Create ticket").click() 995 self.assertMatches('... This payment ticket already exists...',995 self.assertMatches('...Payment ticket created...', 996 996 self.browser.contents) 997 997 … … 1008 1008 self.browser.contents) 1009 1009 1010 # Now the first ticket is paid and no more ticket of same type 1011 # (with same p_item, p_session and p_category) can be added 1012 self.browser.open(self.payments_student_path) 1013 self.browser.getControl("Add online payment ticket").click() 1014 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1015 self.browser.getControl("Create ticket").click() 1016 self.assertMatches( 1017 '...This type of payment ticket exists and ticket has been paid...', 1018 self.browser.contents) 1019 1010 1020 # Managers can open the pdf payment receipt 1021 self.browser.open(payment_url) 1011 1022 self.browser.getLink("Download payment receipt").click() 1012 1023 self.assertEqual(self.browser.headers['Status'], '200 Ok') … … 1033 1044 self.assertEqual(len(self.app['accesscodes']['CLR-0']),0) 1034 1045 ctrl = self.browser.getControl(name='val_id') 1035 value = ctrl.options[ 0]1046 value = ctrl.options[1] # The clearance payment is the second in the table 1036 1047 self.browser.getLink(value).click() 1037 1048 self.browser.open(self.browser.url + '/callback') … … 1042 1053 Paid 1043 1054 </td>...''' 1055 #import pdb; pdb.set_trace() 1044 1056 self.assertMatches(expected,self.browser.contents) 1045 1057 # The new CLR-0 pin has been created
Note: See TracChangeset for help on using the changeset viewer.