Changeset 17396 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 27 Apr 2023, 13:52:09 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r17395 r17396 9 9 from waeup.uniben.students.export import ( 10 10 CustomStudentExporter, CustomStudentPaymentExporter, 11 MedicalHistoryExporter )11 MedicalHistoryExporter, NYSCExporter) 12 12 from waeup.uniben.testing import FunctionalLayer 13 13 … … 152 152 ) 153 153 return 154 155 curr_year = datetime.datetime.now().year 156 year_range = range(curr_year - 11, curr_year + 1) 157 year_range_str = ','.join([str(i) for i in year_range]) 158 159 class NYSCExporterTest(StudentImportExportSetup): 160 161 layer = FunctionalLayer 162 163 def setUp(self): 164 super(NYSCExporterTest, self).setUp() 165 self.setup_for_export() 166 return 167 168 def test_ifaces(self): 169 # make sure we fullfill interface contracts 170 obj = NYSCExporter() 171 verifyObject(ICSVExporter, obj) 172 verifyClass(ICSVExporter, NYSCExporter) 173 return 174 175 def test_export_all(self): 176 # we can really export students 177 # set values we can expect in export file 178 self.setup_student(self.student) 179 self.student.nysc = True 180 exporter = NYSCExporter() 181 exporter.export_all(self.app, self.outfile) 182 result = open(self.outfile, 'rb').read() 183 self.assertMatches( 184 'student_id,matric_number,reg_number,firstname,middlename,lastname,' 185 'sex,nationality,date_of_birth,state,current_mode,certcode,faccode,' 186 'depcode,current_level,current_session,current_verdict,' 187 'entry_sessionfaccode,depcode,certcode,%s\r\n' 188 'A111111,234,123,Anna,M.,Tester,f,NG,1981-02-04#,created,ug_ft,' 189 'CERT1,NA,NA,200,2012,0,,NA,CERT1,,,,,,12.12,,,,,,\r\n' % year_range_str, 190 result 191 ) 192 return
Note: See TracChangeset for help on using the changeset viewer.