Changeset 17760 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 11 May 2024, 07:45:54 (8 months ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
r16431 r17760 23 23 from waeup.kofa.applicants.interfaces import ( 24 24 IApplicantBaseData, IApplicantsContainer, IApplicantOnlinePayment, 25 IApplicantRefereeReport )25 IApplicantRefereeReport, IApplicant) 26 26 from waeup.kofa.interfaces import ICSVExporter 27 27 from waeup.kofa.interfaces import MessageFactory as _ … … 80 80 grok.name('applicants') 81 81 82 fields = tuple(sorted(iface_names(IApplicant BaseData))) + (82 fields = tuple(sorted(iface_names(IApplicant))) + ( 83 83 'password', 'state', 'history', 'container_code', 'application_number', 84 84 'display_fullname', 'application_date') … … 93 93 if name.startswith('course') and value is not None: 94 94 value = value.code 95 #elif name == 'school_grades': 96 # value = [eval(entry.to_string()) for entry in value] 95 elif name == 'school_grades' and value is not None: 96 value = [eval(entry.to_string()) for entry in value] 97 elif name == 'referees' and value is not None: 98 value = [eval(entry.to_string()) for entry in value] 97 99 elif name == 'history': 98 100 value = getattr(value, 'messages', None) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r16976 r17760 19 19 from waeup.kofa.interfaces import ICSVExporter 20 20 from waeup.kofa.schoolgrades import ResultEntry 21 from waeup.kofa.refereeentries import RefereeEntry 21 22 from waeup.kofa.testing import KofaUnitTestLayer, FunctionalLayer 22 23 from waeup.kofa.utils.utils import KofaUtils … … 127 128 KofaUtils.EXAM_GRADES[0][0] 128 129 ) 129 applicant.school_grades = [ 130 result_entry] 130 applicant.school_grades = [result_entry] 131 referee_entry = RefereeEntry(u'John Doe', 'john@aa.aa') 132 applicant.referees = [referee_entry] 131 133 return applicant 132 134 … … 143 145 'applicant_id,course1,course2,course_admitted,date_of_birth,' 144 146 'email,firstname,lastname,locked,middlename,notice,phone,' 145 're g_number,sex,special_application,student_id,suspended,'146 ' password,state,history,container_code,application_number,'147 ' display_fullname,application_date\r\n'148 'dp2011_654321,,,,,,Anna,Tester ,0'147 'referees,reg_number,school_grades,sex,special_application,' 148 'student_id,suspended,password,state,history,container_code,' 149 'application_number,display_fullname,application_date\r\n' 150 'dp2011_654321,,,,,,Anna,Tester' 149 151 in result) 150 152 self.assertTrue( … … 166 168 'applicant_id,course1,course2,course_admitted,date_of_birth,' 167 169 'email,firstname,lastname,locked,middlename,notice,phone,' 168 're g_number,sex,special_application,student_id,suspended,'169 ' password,state,history,container_code,application_number,'170 ' display_fullname,application_date\r\n'170 'referees,reg_number,school_grades,sex,special_application,' 171 'student_id,suspended,password,state,history,container_code,' 172 'application_number,display_fullname,application_date\r\n' 171 173 'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04#,' 172 174 'anna@sample.com,Anna,Tester,' … … 189 191 'applicant_id,course1,course2,course_admitted,date_of_birth,' 190 192 'email,firstname,lastname,locked,middlename,notice,phone,' 191 're g_number,sex,special_application,student_id,suspended,'192 ' password,state,history,container_code,application_number,'193 ' display_fullname,application_date\r\n'193 'referees,reg_number,school_grades,sex,special_application,' 194 'student_id,suspended,password,state,history,container_code,' 195 'application_number,display_fullname,application_date\r\n' 194 196 'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04#,' 195 197 'anna@sample.com,Anna,Tester,' … … 198 200 'Application initialized by system\'],dp2011,654321,' 199 201 'Anna M. Tester,\r\n' 202 in result) 203 self.assertTrue( 204 '[(\'computer_science\', \'A\')]' 205 in result) 206 self.assertTrue( 207 '[(u\'John Doe\', \'john@aa.aa\', False)]' 200 208 in result) 201 209 return … … 210 218 'applicant_id,course1,course2,course_admitted,date_of_birth,' 211 219 'email,firstname,lastname,locked,middlename,notice,phone,' 212 're g_number,sex,special_application,student_id,suspended,'213 ' password,state,history,container_code,application_number,'214 ' display_fullname,application_date\r\n'220 'referees,reg_number,school_grades,sex,special_application,' 221 'student_id,suspended,password,state,history,container_code,' 222 'application_number,display_fullname,application_date\r\n' 215 223 'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04#,' 216 224 'anna@sample.com,Anna,Tester,' … … 230 238 'applicant_id,course1,course2,course_admitted,date_of_birth,' 231 239 'email,firstname,lastname,locked,middlename,notice,phone,' 232 're g_number,sex,special_application,student_id,suspended,'233 ' password,state,history,container_code,application_number,'234 ' display_fullname,application_date\r\n'240 'referees,reg_number,school_grades,sex,special_application,' 241 'student_id,suspended,password,state,history,container_code,' 242 'application_number,display_fullname,application_date\r\n' 235 243 in result) 236 244 return
Note: See TracChangeset for help on using the changeset viewer.