Changeset 13043 for main/waeup.aaue
- Timestamp:
- 12 Jun 2015, 07:27:02 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/payments.py
r12899 r13043 22 22 from zope.component.interfaces import IFactory 23 23 from zope.interface import implementedBy 24 from zope.schema.interfaces import ConstraintNotSatisfied 25 from hurry.workflow.interfaces import IWorkflowInfo 24 26 from waeup.kofa.students.interfaces import IStudentNavigation 25 27 from waeup.kofa.students.payments import ( 26 28 StudentOnlinePayment, StudentOnlinePaymentFactory) 29 from waeup.kofa.students.workflow import CLEARED 27 30 from waeup.kofa.utils.helpers import attrs_to_fields 28 31 from waeup.kofa.accesscodes import create_accesscode … … 44 47 return 45 48 46 def _redeemTicket(self):49 def redeemTicket(self): 47 50 student = self.student 48 51 if self.p_category in ('schoolfee', 'schoolfee_1'): 52 # Bypass activation code creation if next session 53 # can be started directly. 54 if student['studycourse'].next_session_allowed: 55 try: 56 if student.state == CLEARED: 57 IWorkflowInfo(student).fireTransition( 58 'pay_first_school_fee') 59 return None 60 elif student.state == RETURNING: 61 IWorkflowInfo(student).fireTransition( 62 'pay_school_fee') 63 return None 64 elif student.state == PAID: 65 IWorkflowInfo(student).fireTransition( 66 'pay_pg_fee') 67 return None 68 except ConstraintNotSatisfied: 69 pass 49 70 # Create SFE access code 50 71 pin, error = create_accesscode( -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13038 r13043 173 173 self.assertEqual(self.browser.headers['Status'], '200 Ok') 174 174 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 175 # If school fee ticket is paid ... 175 # If school fee ticket is paid, the student is automatically set to 176 # school fee paid... 176 177 ticket = self.student['payments'][sfpt_value].approveStudentPayment() 178 self.assertEqual(self.student.state, 'school fee paid') 177 179 # ... no further school fee ticket can be added. 178 180 self.browser.open(self.payments_path + '/addop') 179 181 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 180 182 self.browser.getControl("Create ticket").click() 181 self.assertMatches('... This type of payment has already been made...',183 self.assertMatches('...Wrong state...', 182 184 self.browser.contents) 183 185 self.browser.open(self.payments_path + '/addop')
Note: See TracChangeset for help on using the changeset viewer.