Ignore:
Timestamp:
22 May 2015, 07:17:29 (10 years ago)
Author:
Henrik Bettermann
Message:

Remove quite old bug in doImport: Replace empty strings *and* lists with
ignore-markers in update *and* create mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r12873 r12981  
    513513            'reg_number,firstname,student_id,sex,email,phone,state,date_of_birth,lastname,password,matric_number,--ERRORS--\r\n'
    514514            '4,John,D123456,m,aa@aa.ng,1234,nonsense,1990-01-05,Wolter,mypw1,100003,state: not allowed\r\n'
    515             '5,John,E123456,x,aa@aa.ng,1234,,1990-01-06,Kennedy,,100004,sex: Invalid value\r\n'
     515            '5,John,E123456,x,aa@aa.ng,1234,<IGNORE>,1990-01-06,Kennedy,<IGNORE>,100004,sex: Invalid value\r\n'
    516516            )
    517517        students = self.app['students']
     
    547547            '1,Aaren,B123456,m,aa@aa.ng,1234,cleared,1990-01-03,Finau,mypw1,100001,reg_number: Invalid input\r\n'
    548548            '2,Aaren,C123456,m,aa@aa.ng,1234,admitted,1990-01-04,Berson,mypw1,100000,matric_number: Invalid input\r\n'
    549             '1,Frank,F123456,m,aa@aa.ng,1234,,1990-01-06,Meyer,,100000,reg_number: Invalid input; matric_number: Invalid input\r\n'
    550             '3,Uli,A123456,m,aa@aa.ng,1234,,1990-01-07,Schulz,,100002,This object already exists.\r\n'
     549            '1,Frank,F123456,m,aa@aa.ng,1234,<IGNORE>,1990-01-06,Meyer,<IGNORE>,100000,reg_number: Invalid input; matric_number: Invalid input\r\n'
     550            '3,Uli,A123456,m,aa@aa.ng,1234,<IGNORE>,1990-01-07,Schulz,<IGNORE>,100002,This object already exists.\r\n'
    551551            )
    552552        shutil.rmtree(os.path.dirname(fin_file))
     
    780780        self.assertEqual(studylevel.__parent__.certificate.code, u'CERT1')
    781781        self.assertEqual(studylevel.level_session, 2008)
    782         self.assertEqual(studylevel.level_verdict, None)
     782        self.assertEqual(studylevel.level_verdict, '0')
    783783        self.assertEqual(studylevel.level, 100)
    784784        shutil.rmtree(os.path.dirname(fin_file))
     
    891891        self.assertEqual(fail_file,
    892892            'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    893             '1,COURSE1,,nonsense,,5,,Not all parents do exist yet.\r\n'
    894             '1,NONSENSE,,100,,5,,code: non-existent\r\n'
    895             '1,COURSE1,,200,2004,6,,level_session: does not match 2008\r\n'
    896             '1,COURSE1,,300,2008,6,,level: does not exist\r\n'
    897             '1,COURSE1,,300,2008X,6,,level_session: Invalid value\r\n')
     893            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n'
     894            '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     895            '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
     896            '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level: does not exist\r\n'
     897            '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
    898898        assert self.processor.entryExists(
    899899            dict(reg_number='1', level='100', code='COURSE1'),
     
    12201220        studycourse = self.processor.getEntry(dict(matric_number='100000'),
    12211221                                              self.app)
    1222         self.assertEqual(studycourse['200'].level_verdict, None)
     1222        self.assertEqual(studycourse['200'].level_verdict, '0')
    12231223        student = self.processor.getParent(
    12241224            dict(matric_number='100000'), self.app)
Note: See TracChangeset for help on using the changeset viewer.