Changeset 12971 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 21 May 2015, 07:38:15 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r12865 r12971 32 32 StudentPaymentsOverviewExporter, StudentStudyLevelsOverviewExporter, 33 33 ComboCardDataExporter, DataForBursaryExporter, 34 StudentUnpaidPaymentExporter, 34 35 get_students,) 35 36 from waeup.kofa.students.accommodation import BedTicket … … 895 896 result = open(self.outfile, 'rb').read() 896 897 898 return 899 900 class StudentUnpaidPaymentExporterTest(StudentImportExportSetup): 901 902 layer = FunctionalLayer 903 904 def setUp(self): 905 super(StudentUnpaidPaymentExporterTest, self).setUp() 906 self.setup_for_export() 907 return 908 909 def test_export_all(self): 910 # we can really export all payments 911 # set values we can expect in export file 912 self.setup_student(self.student) 913 exporter = StudentUnpaidPaymentExporter() 914 exporter.export_all(self.app, self.outfile) 915 result = open(self.outfile, 'rb').read() 916 # No unpaid ticket exists 917 self.assertEqual( 918 result, 919 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 920 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 921 'r_code,r_desc,student_id,state,current_session\r\n' 922 ) 923 # Make ticket unpaid 924 self.payment.p_state = 'unpaid' 925 exporter.export_all(self.app, self.outfile) 926 result = open(self.outfile, 'rb').read() 927 self.assertEqual( 928 result, 929 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 930 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 931 'r_code,r_desc,student_id,state,current_session\r\n' 932 933 '666,12.12,2012-04-01 13:12:01#,schoolfee,1,my-id,' 934 'p-item,100,2012,unpaid,2012-04-01 14:12:01#,12.12,' 935 'r-code,,A111111,created,2012\r\n' 936 ) 897 937 return 898 938 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r12104 r12971 182 182 183 183 # The student data were put into CSV files 184 STUDENT_ EXPORTER_NAMES = getUtility(185 IStudentsUtils).STUDENT_ EXPORTER_NAMES186 187 for name in STUDENT_ EXPORTER_NAMES:184 STUDENT_BACKUP_EXPORTER_NAMES = getUtility( 185 IStudentsUtils).STUDENT_BACKUP_EXPORTER_NAMES 186 187 for name in STUDENT_BACKUP_EXPORTER_NAMES: 188 188 csv_path = os.path.join(del_dir, '%s.csv' % name) 189 189 self.assertTrue(os.path.isfile(csv_path))
Note: See TracChangeset for help on using the changeset viewer.