Changeset 8052 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 6 Apr 2012, 15:27:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r8047 r8052 119 119 applicant.screening_score = 98 120 120 applicant.screening_venue = u'Exam Room' 121 applicant.password = 'any password' 121 122 result_entry = ResultEntry( 122 123 KofaUtils.EXAM_SUBJECTS_DICT.keys()[0], … … 133 134 exporter.export([self.applicant], self.outfile) 134 135 result = open(self.outfile, 'rb').read() 135 self.assertEqual( 136 result, 137 'applicant_id,course1,course2,course_admitted,date_of_birth,' 138 'email,firstname,lastname,lga,middlename,notice,phone,' 139 'reg_number,screening_score,screening_venue,sex\r\n' 140 141 'dp2011_654321,,,,,,Anna,Tester,foreigner,,,,,,,\r\n' 142 ) 136 # The exported records do contain real dates in their 137 # history dict. Therefore we have to split the comparison 138 # into two parts. 139 self.assertTrue( 140 'applicant_id,application_date,application_number,course1,course2,' 141 'course_admitted,date_of_birth,display_fullname,email,firstname,' 142 'history,lastname,lga,locked,middlename,notice,password,phone,' 143 'reg_number,screening_score,screening_venue,sex,state,' 144 'student_id\r\n' 145 'dp2011_654321,,654321,,,,,Anna Tester,,Anna,' 146 in result) 147 self.assertTrue( 148 'Application initialized by system\'],Tester,' 149 'foreigner,0,,,,,,,,,initialized,\r\n' 150 in result) 143 151 return 144 152 … … 150 158 exporter.export([applicant], self.outfile) 151 159 result = open(self.outfile, 'rb').read() 152 self.assertEqual( 153 result, 154 'applicant_id,course1,course2,course_admitted,date_of_birth,' 155 'email,firstname,lastname,lga,middlename,notice,phone,' 156 'reg_number,screening_score,screening_venue,' 157 'sex\r\n' 158 159 'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04,anna@sample.com,' 160 'Anna,Tester,foreigner,M.,"Some notice\nin lines.",' 161 '+234-123-12345,123456,98,Exam Room,f\r\n' 162 ) 160 # The exported records do contain real dates in their 161 # history dict. Therefore we have to split the comparison 162 # into two parts. 163 self.assertTrue( 164 'applicant_id,application_date,application_number,course1,course2,' 165 'course_admitted,date_of_birth,display_fullname,email,firstname,' 166 'history,lastname,lga,locked,middlename,notice,password,phone,' 167 'reg_number,screening_score,screening_venue,sex,state,' 168 'student_id\r\n' 169 'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,' 170 'Anna M. Tester,anna@sample.com,Anna,' 171 in result) 172 self.assertTrue( 173 'Application initialized by system\'],' 174 'Tester,foreigner,0,M.,"Some notice\nin lines.",any password,' 175 '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n' 176 in result) 177 163 178 return 164 179 … … 170 185 exporter.export_all(self.app, self.outfile) 171 186 result = open(self.outfile, 'rb').read() 172 self.assertEqual( 173 result, 174 'applicant_id,course1,course2,course_admitted,date_of_birth,' 175 'email,firstname,lastname,lga,middlename,notice,phone,' 176 'reg_number,screening_score,screening_venue,' 177 'sex\r\n' 178 179 'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04,anna@sample.com,' 180 'Anna,Tester,foreigner,M.,"Some notice\nin lines.",' 181 '+234-123-12345,123456,98,Exam Room,f\r\n' 182 ) 183 return 187 self.assertTrue( 188 'applicant_id,application_date,application_number,course1,course2,' 189 'course_admitted,date_of_birth,display_fullname,email,firstname,' 190 'history,lastname,lga,locked,middlename,notice,password,phone,' 191 'reg_number,screening_score,screening_venue,sex,state,' 192 'student_id\r\n' 193 'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,' 194 'Anna M. Tester,anna@sample.com,Anna,' 195 in result) 196 self.assertTrue( 197 'Application initialized by system\'],' 198 'Tester,foreigner,0,M.,"Some notice\nin lines.",any password,' 199 '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n' 200 in result) 201 return
Note: See TracChangeset for help on using the changeset viewer.