Changeset 16390 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 29 Jan 2021, 11:03:57 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r16382 r16390 8 8 from waeup.uniben.utils.utils import CustomKofaUtils 9 9 from waeup.uniben.students.export import ( 10 CustomStudentExporter, CustomStudentPaymentExporter) 10 CustomStudentExporter, CustomStudentPaymentExporter, 11 MedicalHistoryExporter) 11 12 from waeup.uniben.testing import FunctionalLayer 12 13 … … 114 115 ) 115 116 return 117 118 class MedicalHistoryExporterTest(StudentImportExportSetup): 119 120 layer = FunctionalLayer 121 122 def setUp(self): 123 super(MedicalHistoryExporterTest, self).setUp() 124 self.setup_for_export() 125 return 126 127 def test_ifaces(self): 128 # make sure we fullfill interface contracts 129 obj = MedicalHistoryExporter() 130 verifyObject(ICSVExporter, obj) 131 verifyClass(ICSVExporter, MedicalHistoryExporter) 132 return 133 134 def test_export_all(self): 135 # we can really export students 136 # set values we can expect in export file 137 self.setup_student(self.student) 138 self.student.sore_throat = True 139 exporter = MedicalHistoryExporter() 140 exporter.export_all(self.app, self.outfile) 141 result = open(self.outfile, 'rb').read() 142 self.assertMatches( 143 'asthma,body_pains,breathing,catarrh,company_confirmed,' 144 'company_suspected,cough,diabetes,fever,headaches,hypertension,' 145 'lagos_abuja,medical_updated,medicines,negative,obesity,' 146 'others,outside,positive,smell,sneezing,sore_throat,taste,' 147 'vaccination,weakness,student_id,display_fullname,' 148 'matric_number,faccode,depcode,state,current_session,' 149 'current_level\r\n' 150 ',,,,,,,,,,,,,,,,,,,,,1,,,,A111111,Anna M. Tester,234,' 151 'NA,NA,created,2012,200\r\n' , result 152 ) 153 return
Note: See TracChangeset for help on using the changeset viewer.