Changeset 15979 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 4 Feb 2020, 10:06:02 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15966 r15979 39 39 TranscriptDataExporter, 40 40 TrimmedDataExporter, 41 StudentTrimmedPaymentExporter, 41 42 get_students,) 42 43 from waeup.kofa.students.accommodation import BedTicket … … 1089 1090 ) 1090 1091 return 1092 1093 class StudentTrimmedPaymentExporterTest(StudentImportExportSetup): 1094 1095 layer = FunctionalLayer 1096 1097 def setUp(self): 1098 super(StudentTrimmedPaymentExporterTest, self).setUp() 1099 self.setup_for_export() 1100 return 1101 1102 def test_ifaces(self): 1103 # make sure we fullfill interface contracts 1104 obj = StudentTrimmedPaymentExporter() 1105 verifyObject(ICSVStudentExporter, obj) 1106 verifyClass(ICSVStudentExporter, StudentTrimmedPaymentExporter) 1107 return 1108 1109 def test_get_as_utility(self): 1110 # we can get a payments exporter as utility 1111 result = queryUtility(ICSVExporter, name="trimmedpayments") 1112 self.assertTrue(result is not None) 1113 return 1114 1115 def test_export_all(self): 1116 # we can really export all payments 1117 # set values we can expect in export file 1118 self.setup_student(self.student) 1119 exporter = StudentTrimmedPaymentExporter() 1120 exporter.export_all(self.app, self.outfile) 1121 result = open(self.outfile, 'rb').read() 1122 self.assertEqual( 1123 result, 1124 'amount_auth,creation_date,p_category,p_combi,p_current,' 1125 'p_id,p_item,p_level,p_session,p_state,payment_date,' 1126 'r_amount_approved,r_code,r_desc,student_id,faccode,' 1127 'depcode,state,current_session\r\n' 1128 1129 '12.12,%s-04-01 13:12:01#,schoolfee,[],1,my-id,p-item,' 1130 '100,%s,paid,%s-04-01 14:12:01#,12.12,r-code,,' 1131 'A111111,NA,NA,created,2012\r\n' 1132 % (curr_year-6, curr_year-6, curr_year-6) 1133 ) 1134 return 1135 1091 1136 1092 1137 class UnpaidPaymentsExporterTest(StudentImportExportSetup):
Note: See TracChangeset for help on using the changeset viewer.