Changeset 8609
- Timestamp:
- 3 Jun 2012, 08:14:29 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_faulty_applicant_data.csv
r8291 r8609 1 1 application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename,password 2 2 ,dp2011,1001,Aaren,Pieri,01/02/1990,xx@yy.zz,CERT1,m,Claus, 3 5678,dp2011,1005,Jim,Knopf,1990-01-06,xx@yy.zz,CERT2,m,, -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r8353 r8609 316 316 317 317 def test_import_faulty(self): 318 num, num_warns, fin_file, fail_file = self.processor.doImport( 319 self.csv_file_faulty, APPLICANT_HEADER_FIELDS) 318 320 # we cannot import data with faulty dates. A date is faulty 319 321 # when in format xx/yy/zzzz as we cannot say whether it is 320 322 # meant as dd/mm/yyyy or mm/dd/yyyy. We therefore require yyyy-mm-dd 321 num, num_warns, fin_file, fail_file = self.processor.doImport(322 self.csv_file_faulty, APPLICANT_HEADER_FIELDS)323 if fail_file is not None:324 fail_contents = open(fail_file, 'rb').read()325 shutil.rmtree(os.path.dirname(fail_file))326 else:327 shutil.rmtree(os.path.dirname(fin_file))328 323 for applicant in self.app['applicants']['dp2011'].values(): 329 324 if applicant.date_of_birth == datetime.date(1990, 1, 2): … … 331 326 'Wrong birthdate of imported applicant ' 332 327 '(1990-01-02, should be: 1990-02-01)') 328 # CERT2 does not exist. 329 fail_contents = open(fail_file, 'rb').read() 330 shutil.rmtree(os.path.dirname(fail_file)) 331 self.assertTrue('course1: Invalid value' in fail_contents) 333 332 return 334 333
Note: See TracChangeset for help on using the changeset viewer.