Ignore:
Timestamp:
28 Oct 2018, 17:30:45 (6 years ago)
Author:
Henrik Bettermann
Message:

Implement study level 0 (Level Zero) option for storing for
orphaned course tickets (tickets without level information).
Add ticket_session field to ICourseTicket.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students/tests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv

    r9421 r15203  
    1 reg_number,matric_number,level,code,score,mandatory,level_session
    2 1,,100,COURSE1,1,True,
    3 2,,100,COURSE1,2,False,
    4 ,100002,100,COURSE1,3,False,
    5 1,,200,COURSE1,1,True,2008
    6 1,,nonsense,COURSE1,5,,
    7 1,,100,NONSENSE,5,,
    8 1,,200,COURSE1,6,,2004
    9 1,,300,COURSE1,6,,2008
    10 1,,300,COURSE1,6,,2008X
     1reg_number,matric_number,level,code,score,mandatory,level_session,ticket_session
     21,,100,COURSE1,1,True,,
     32,,100,COURSE1,2,False,,
     4,100002,100,COURSE1,3,False,,
     51,,200,COURSE1,1,True,2008,
     61,,nonsense,COURSE1,5,,,
     71,,100,NONSENSE,5,,,
     81,,200,COURSE1,6,,2004,
     91,,300,COURSE1,6,,2008,
     101,,300,COURSE1,6,,2008X,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r15163 r15203  
    957957        self.assertEqual(num_warns,5)
    958958        self.assertEqual(fail_file,
    959             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    960             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n'
    961             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    962             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    963             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    964             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     959            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     960            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n'
     961            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     962            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     963            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     964            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    965965        assert self.processor.entryExists(
    966966            dict(reg_number='1', level='100', code='COURSE1'),
     
    10101010        self.assertEqual(num_warns,5)
    10111011        self.assertEqual(fail_file,
    1012             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    1013             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
    1014             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    1015             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    1016             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    1017             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     1012            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     1013            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
     1014            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     1015            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     1016            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     1017            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    10181018        shutil.rmtree(os.path.dirname(fin_file))
    10191019
     
    10521052        self.assertEqual(num_warns,7)
    10531053        self.assertEqual(fail_file,
    1054             'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
    1055             '1,COURSE1,True,100,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
    1056             '1,COURSE1,True,200,2008,1,<IGNORE>,Studycourse is locked.\r\n'
    1057             '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
    1058             '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
    1059             '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
    1060             '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level object: does not exist\r\n'
    1061             '1,COURSE1,<IGNORE>,300,2008X,6,<IGNORE>,level_session: Invalid value\r\n')
     1054            'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n'
     1055            '1,COURSE1,True,100,<IGNORE>,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
     1056            '1,COURSE1,True,200,2008,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n'
     1057            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
     1058            '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
     1059            '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n'
     1060            '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n'
     1061            '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n')
    10621062        shutil.rmtree(os.path.dirname(fin_file))
    10631063
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r15200 r15203  
    805805        self.browser.getLink("100").click()
    806806        self.assertMatches(
    807             '...: Study Level 100 (Year 1)...', self.browser.contents)
     807            '...: 100 (Year 1)...', self.browser.contents)
    808808        self.browser.getLink("Manage").click()
    809809        self.browser.getControl(name="form.level_session").value = ['2002']
     
    888888        self.browser.getLink("200").click()
    889889        self.assertMatches(
    890             '...: Study Level 200 (Year 2)...', self.browser.contents)
     890            '...: 200 (Year 2)...', self.browser.contents)
    891891        # Since COURSE1 has score 10 it becomes a carry-over course
    892892        # in level 200
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r15163 r15203  
    614614            result,
    615615            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    616             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     616            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    617617            'display_fullname\r\n'
    618             '0,0,,,,,,,,0,0,,,,,,,\r\n'
     618            '0,0,,,,,,,,0,0,,,,,,,,\r\n'
    619619            )
    620620        return
     
    633633            result,
    634634            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    635             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     635            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    636636            'display_fullname\r\n'
    637             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     637            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    638638            'Anna M. Tester\r\n'
    639639            )
     
    650650            result,
    651651            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    652             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     652            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    653653            'display_fullname\r\n'
    654             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     654            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    655655            'Anna M. Tester\r\n'
    656656            )
     
    666666            result,
    667667            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    668             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     668            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    669669            'display_fullname\r\n'
    670             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     670            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    671671            'Anna M. Tester\r\n'
    672672            )
     
    685685            result,
    686686            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    687             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     687            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    688688            'display_fullname\r\n'
    689             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     689            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    690690            'Anna M. Tester\r\n'
    691691            )
     
    699699            result,
    700700            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    701             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     701            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    702702            'display_fullname\r\n'
    703             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     703            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    704704            'Anna M. Tester\r\n'
    705705            )
     
    712712            result,
    713713            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    714             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     714            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    715715            'display_fullname\r\n'
    716             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     716            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    717717            'Anna M. Tester\r\n'
    718718            )
     
    724724            result,
    725725            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    726             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     726            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    727727            'display_fullname\r\n'
    728728                        )
     
    735735            result,
    736736            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    737             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     737            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    738738            'display_fullname\r\n'
    739739            )
     
    747747            result,
    748748            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    749             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     749            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    750750            'display_fullname\r\n'
    751             '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     751            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    752752            'Anna M. Tester\r\n'
    753753            )
     
    758758            result,
    759759            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    760             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     760            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    761761            'display_fullname\r\n'
    762762            )
     
    771771            result,
    772772            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    773             'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
     773            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
    774774            'display_fullname\r\n'
    775             '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     775            '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,,Course 1,A111111,CERT1,'
    776776            'Anna M. Tester\r\n'
    777777            )
     
    13451345             'student_id,state,certcode,faccode,depcode,is_postgrad,'
    13461346             'entry_session,current_level,current_session,'
    1347              '10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
     1347             '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
    13481348             '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n'
    1349              'A111111,created,CERT1,NA,NA,0,2010,200,2012,,2012'
     1349             'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012'
    13501350             ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n',
    13511351            result
     
    13611361            'student_id,state,certcode,faccode,depcode,is_postgrad,'
    13621362            'entry_session,current_level,current_session,'
    1363             '10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
     1363            '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,'
    13641364            '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n'
    1365             'A111111,created,CERT1,NA,NA,0,2010,200,2012,,2012'
     1365            'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012'
    13661366            ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n',
    13671367            result
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py

    r9778 r15203  
    6565        studylevelsource = StudyLevelSource().factory
    6666        values = studylevelsource.getValues(studycourse)
    67         self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320,
     67        self.assertEqual(values, [0, 100, 110, 120, 200, 210, 220, 300, 310, 320,
    6868            400, 410, 420, 500, 510, 520, 600, 610, 620])
    6969        # All titles do exist
    7070        titles = [studylevelsource.getTitle(studycourse, value)
    7171            for value in values]
    72         self.assertEqual(len(titles), 18)
     72        self.assertEqual(len(titles), 19)
    7373        # Unfortunately, unittests don't know about internationalization
    7474        self.assertEqual(studylevelsource.getTitle(studycourse, None),
    7575            'Error: level id ${value} out of range')
    7676        self.assertEqual(studylevelsource.getTitle(studycourse, 0),
     77            'Level Zero')
     78        self.assertEqual(studylevelsource.getTitle(studycourse, 1),
    7779            'Error: level id ${value} out of range')
    7880        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
     
    9698        self.assertEqual(studylevelsource.getTitle(studycourse, 700),
    9799            'Error: level id ${value} out of range')
    98         # Now we modify the certificates to be a pure to pre-studies
     100        # Now we modify the certificates to be a pure pre-studies
    99101        # course
    100102        studycourse.certificate.start_level = 10
    101103        studycourse.certificate.end_level = 10
    102104        values = studylevelsource.getValues(studycourse)
    103         self.assertEqual(values, [10])
     105        self.assertEqual(values, [0, 10])
    104106        titles = [studylevelsource.getTitle(studycourse, value)
    105107            for value in values]
    106         self.assertEqual(len(titles), 1)
     108        self.assertEqual(len(titles), 2)
    107109        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
    108110            'Pre-Studies')
     
    115117        studycourse.certificate.end_level = 200
    116118        values = studylevelsource.getValues(studycourse)
    117         self.assertEqual(values, [10, 100, 110, 120,
     119        self.assertEqual(values, [0, 10, 100, 110, 120,
    118120            200, 210, 220, 300, 310, 320])
    119121        titles = [studylevelsource.getTitle(studycourse, value)
    120122            for value in values]
    121         self.assertEqual(len(titles), 10)
     123        self.assertEqual(len(titles), 11)
    122124        # Repeating Pre-Studies level does not exist and raises a KeyError
    123125        # when trying to get its title
Note: See TracChangeset for help on using the changeset viewer.