- Timestamp:
- 3 Jun 2012, 08:14:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.