Changeset 15666 for main/waeup.uniben/trunk
- Timestamp:
- 13 Oct 2019, 20:40:12 (5 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r15638 r15666 123 123 return form_fields 124 124 125 def dataNotComplete(self , data):125 def dataNotComplete(self): 126 126 store = getUtility(IExtFileStore) 127 127 if not store.getFileByContext(self.context, attr=u'birth_certificate.jpg'): … … 143 143 """ 144 144 form_fields = grok.AutoFields(ICustomStudentOnlinePayment).select( 145 'p_c ategory')145 'p_combi') 146 146 147 147 class CustomExportPDFPaymentSlip(NigeriaExportPDFPaymentSlip): -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r15574 r15666 553 553 554 554 error, payment = utils.setPaymentDetails('schoolfee', 555 self.student, None, None )555 self.student, None, None, None) 556 556 self.assertEqual(payment, None) 557 557 # Student is in state 'created' and can thus not pay. … … 560 560 # Previous session must be valid. 561 561 error, payment = utils.setPaymentDetails('schoolfee', 562 self.student, 2000, 300 )562 self.student, 2000, 300, None) 563 563 self.assertEqual(payment, None) 564 564 self.assertTrue(u'The previous session must not fall below' in error) 565 565 error, payment = utils.setPaymentDetails('schoolfee', 566 self.student, 2005, 300 )566 self.student, 2005, 300, None) 567 567 self.assertEqual(payment, None) 568 568 self.assertTrue(u'This is not a previous session' in error) … … 571 571 # are distinguished by their entry_level 572 572 error, payment = utils.setPaymentDetails('schoolfee', 573 self.student, 2002, 300 )573 self.student, 2002, 300, None) 574 574 self.assertEqual(payment.amount_auth, 40000.0) 575 575 self.assertEqual(payment.p_session, 2002) … … 577 577 self.assertFalse(payment.p_current) 578 578 error, payment = utils.setPaymentDetails('schoolfee', 579 self.student, 2003, 300 )579 self.student, 2003, 300, None) 580 580 self.assertEqual(payment.amount_auth, 20000.0) 581 581 self.assertEqual(payment.p_session, 2003) … … 587 587 IWorkflowState(self.student).setState('cleared') 588 588 error, payment = utils.setPaymentDetails('schoolfee', 589 self.student, None, None )589 self.student, None, None, None) 590 590 self.assertEqual(payment.p_level, 100) 591 591 self.assertEqual(payment.p_session, 2004) … … 601 601 self.app['configuration']['2005'].penalty_ug_ft = 88.0 602 602 error, payment = utils.setPaymentDetails('schoolfee', 603 self.student, None, None )603 self.student, None, None, None) 604 604 self.assertEqual(payment.amount_auth, 40099.0) 605 605 … … 607 607 608 608 #error, payment = utils.setPaymentDetails('schoolfee', 609 # self.student, None, None )609 # self.student, None, None, None) 610 610 #self.assertTrue( 611 611 # u'You have not yet paid your current/active session.' in error) … … 620 620 621 621 error, payment = utils.setPaymentDetails('schoolfee', 622 self.student, None, None )622 self.student, None, None, None) 623 623 self.assertEqual(payment.p_level, 200) 624 624 self.assertEqual(payment.p_session, 2005) … … 631 631 self.certificate.custom_float_1 = 30000.0 632 632 error, payment = utils.setPaymentDetails( 633 'schoolfee', self.student, None, None )633 'schoolfee', self.student, None, None, None) 634 634 self.assertEqual(payment.amount_auth, 20088.0) 635 635 … … 638 638 self.student.is_staff = True 639 639 error, payment = utils.setPaymentDetails('schoolfee', 640 self.student, None, None )640 self.student, None, None, None) 641 641 self.assertEqual(payment.p_level, 200) 642 642 self.assertEqual(payment.p_session, 2005) … … 651 651 self.certificate.school_fee_3 = 60000.0 652 652 error, payment = utils.setPaymentDetails( 653 'schoolfee', self.student, None, None )653 'schoolfee', self.student, None, None, None) 654 654 self.assertEqual(payment.p_level, 100) 655 655 self.assertEqual(payment.p_session, 2004) … … 661 661 self.certificate.school_fee_4 = 20000.0 662 662 error, payment = utils.setPaymentDetails( 663 'schoolfee', self.student, None, None )663 'schoolfee', self.student, None, None, None) 664 664 self.assertEqual(payment.p_level, 200) 665 665 self.assertEqual(payment.p_session, 2005) … … 676 676 #self.certificate.school_fee_2 = 10000.0 677 677 #error, payment = utils.setPaymentDetails( 678 # 'schoolfee', self.student, None, None )678 # 'schoolfee', self.student, None, None, None) 679 679 #self.assertEqual(payment.p_level, None) 680 680 #self.assertEqual(payment.p_session, 2005) … … 685 685 #self.certificate.study_mode = 'special_pg_pt' 686 686 #error, payment = utils.setPaymentDetails( 687 # 'schoolfee', self.student, None, None )687 # 'schoolfee', self.student, None, None, None) 688 688 #self.assertEqual(payment.p_level, None) 689 689 #self.assertEqual(payment.p_session, 2005) … … 693 693 #IWorkflowState(self.student).setState('courses validated') 694 694 #error, payment = utils.setPaymentDetails( 695 # 'schoolfee', self.student, None, None )695 # 'schoolfee', self.student, None, None, None) 696 696 #self.assertEqual(payment.p_level, None) 697 697 #self.assertEqual(payment.p_session, 2005) … … 701 701 702 702 error, payment = utils.setPaymentDetails('clearance', 703 self.student, None, None )703 self.student, None, None, None) 704 704 self.assertEqual(payment.p_level, 100) 705 705 self.assertEqual(payment.p_session, 2004) … … 709 709 710 710 error, payment = utils.setPaymentDetails('gown', 711 self.student, None, None )711 self.student, None, None, None) 712 712 self.assertEqual(payment.p_level, 100) 713 713 self.assertEqual(payment.p_session, 2004) … … 724 724 725 725 error, payment = utils.setPaymentDetails('hostel_maintenance', 726 self.student, None, None )726 self.student, None, None, None) 727 727 self.assertEqual(payment.p_level, 100) 728 728 self.assertEqual(payment.p_session, 2004) … … 733 733 #self.certificate.study_mode = 'ug_ft' 734 734 #error, payment = utils.setPaymentDetails('bed_allocation', 735 # self.student, None, None )735 # self.student, None, None, None) 736 736 #self.assertTrue(u'Amount could not be determined.' in error) 737 737 #self.student['studycourse'].current_session = 2004 … … 739 739 #self.student['studycourse'].current_level = 100 740 740 #error, payment = utils.setPaymentDetails('bed_allocation', 741 # self.student, None, None )741 # self.student, None, None, None) 742 742 #self.assertEqual(payment.p_level, 100) 743 743 #self.assertEqual(payment.p_session, 2004) … … 748 748 self.certificate.study_mode = 'pg_ft' 749 749 error, payment = utils.setPaymentDetails('bed_allocation', 750 self.student, None, None )750 self.student, None, None, None) 751 751 self.assertEqual(error, u'Select your favoured hostel first.') 752 752 self.student['accommodation'].desired_hostel = u'no' 753 753 error, payment = utils.setPaymentDetails('bed_allocation', 754 self.student, None, None )754 self.student, None, None, None) 755 755 self.assertEqual(payment.p_level, 100) 756 756 self.assertEqual(payment.p_session, 2004) … … 760 760 761 761 #error, payment = utils.setPaymentDetails('hostel_application', 762 # self.student, None, None )762 # self.student, None, None, None) 763 763 #self.assertEqual(payment.p_level, 100) 764 764 #self.assertEqual(payment.p_session, 2004) … … 771 771 772 772 #error, payment = utils.setPaymentDetails('tempmaint_1', 773 # self.student, None, None )773 # self.student, None, None, None) 774 774 #self.assertEqual(payment.p_level, 100) 775 775 #self.assertEqual(payment.p_session, 2004) … … 779 779 780 780 #error, payment = utils.setPaymentDetails('tempmaint_2', 781 # self.student, None, None )781 # self.student, None, None, None) 782 782 #self.assertEqual(payment.p_level, 100) 783 783 #self.assertEqual(payment.p_session, 2004) … … 787 787 788 788 #error, payment = utils.setPaymentDetails('tempmaint_3', 789 # self.student, None, None )789 # self.student, None, None, None) 790 790 #self.assertEqual(payment.p_level, 100) 791 791 #self.assertEqual(payment.p_session, 2004) … … 795 795 796 796 error, payment = utils.setPaymentDetails('transfer', 797 self.student, None, None )797 self.student, None, None, None) 798 798 self.assertEqual(payment.p_level, 100) 799 799 self.assertEqual(payment.p_session, 2004) -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r15371 r15666 59 59 'marit_stat,matric_number,middlename,nationality,' 60 60 'next_kin_address,next_kin_name,next_kin_phone,next_kin_relation,' 61 'nysc_lga,nysc_location,nysc_year,officer_comment,parent_email, '61 'nysc_lga,nysc_location,nysc_year,officer_comment,parent_email,parents_email,' 62 62 'perm_address,personal_updated,phone,' 63 63 'physical_clearance_date,provisionally_cleared,reg_number,' … … 68 68 '"[(\'printing_craft_practice\', \'A1\')]",my clr code,1981-02-04#,,,' 69 69 'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"' 70 ',,,,,,,,,,,,,,,,Tester,,,,234,M.,NG,,,,,,,,,, '70 ',,,,,,,,,,,,,,,,Tester,,,,234,M.,NG,,,,,,,,,,,' 71 71 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,' 72 72 '"[(\'printing_craft_practice\', \'A1\')]",,f,A111111,0,,,created,' … … 103 103 result = open(self.outfile, 'rb').read() 104 104 self.assertMatches( 105 'ac,amount_auth,creation_date,gateway_amt,p_category,p_c urrent,'105 'ac,amount_auth,creation_date,gateway_amt,p_category,p_combi,p_current,' 106 106 'p_id,p_item,p_level,p_session,p_state,payment_date,provider_amt,' 107 107 'r_amount_approved,r_card_num,r_code,r_company,r_desc,' 108 108 'r_pay_reference,rebate_amount,staff_rebate,thirdparty_amt,student_id,state,' 109 109 'current_session\r\n' 110 '666,12.12,%s-04-01 13:12:01#,,schoolfee, 1,my-id,p-item,'110 '666,12.12,%s-04-01 13:12:01#,,schoolfee,[],1,my-id,p-item,' 111 111 '100,%s,paid,%s-04-01 14:12:01#,,12.12,' 112 112 '789,r-code,interswatch,,,,,,A111111,created,2012\r\n' -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r15574 r15666 207 207 208 208 def setPaymentDetails(self, category, student, 209 previous_session, previous_level ):209 previous_session, previous_level, combi): 210 210 """Create Payment object and set the payment data of a student for 211 211 the payment category specified.
Note: See TracChangeset for help on using the changeset viewer.