Changeset 15203 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 28 Oct 2018, 17:30:45 (6 years ago)
- 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 1 reg_number,matric_number,level,code,score,mandatory,level_session,ticket_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, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r15163 r15203 957 957 self.assertEqual(num_warns,5) 958 958 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') 965 965 assert self.processor.entryExists( 966 966 dict(reg_number='1', level='100', code='COURSE1'), … … 1010 1010 self.assertEqual(num_warns,5) 1011 1011 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') 1018 1018 shutil.rmtree(os.path.dirname(fin_file)) 1019 1019 … … 1052 1052 self.assertEqual(num_warns,7) 1053 1053 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') 1062 1062 shutil.rmtree(os.path.dirname(fin_file)) 1063 1063 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15200 r15203 805 805 self.browser.getLink("100").click() 806 806 self.assertMatches( 807 '...: Study Level100 (Year 1)...', self.browser.contents)807 '...: 100 (Year 1)...', self.browser.contents) 808 808 self.browser.getLink("Manage").click() 809 809 self.browser.getControl(name="form.level_session").value = ['2002'] … … 888 888 self.browser.getLink("200").click() 889 889 self.assertMatches( 890 '...: Study Level200 (Year 2)...', self.browser.contents)890 '...: 200 (Year 2)...', self.browser.contents) 891 891 # Since COURSE1 has score 10 it becomes a carry-over course 892 892 # in level 200 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15163 r15203 614 614 result, 615 615 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 616 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'616 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 617 617 'display_fullname\r\n' 618 '0,0,,,,,,,,0,0,,,,,,, \r\n'618 '0,0,,,,,,,,0,0,,,,,,,,\r\n' 619 619 ) 620 620 return … … 633 633 result, 634 634 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 635 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'635 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 636 636 '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,' 638 638 'Anna M. Tester\r\n' 639 639 ) … … 650 650 result, 651 651 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 652 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'652 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 653 653 '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,' 655 655 'Anna M. Tester\r\n' 656 656 ) … … 666 666 result, 667 667 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 668 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'668 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 669 669 '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,' 671 671 'Anna M. Tester\r\n' 672 672 ) … … 685 685 result, 686 686 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 687 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'687 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 688 688 '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,' 690 690 'Anna M. Tester\r\n' 691 691 ) … … 699 699 result, 700 700 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 701 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'701 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 702 702 '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,' 704 704 'Anna M. Tester\r\n' 705 705 ) … … 712 712 result, 713 713 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 714 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'714 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 715 715 '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,' 717 717 'Anna M. Tester\r\n' 718 718 ) … … 724 724 result, 725 725 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 726 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'726 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 727 727 'display_fullname\r\n' 728 728 ) … … 735 735 result, 736 736 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 737 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'737 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 738 738 'display_fullname\r\n' 739 739 ) … … 747 747 result, 748 748 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 749 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'749 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 750 750 '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,' 752 752 'Anna M. Tester\r\n' 753 753 ) … … 758 758 result, 759 759 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 760 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'760 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 761 761 'display_fullname\r\n' 762 762 ) … … 771 771 result, 772 772 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 773 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'773 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 774 774 '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,' 776 776 'Anna M. Tester\r\n' 777 777 ) … … 1345 1345 'student_id,state,certcode,faccode,depcode,is_postgrad,' 1346 1346 '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,' 1348 1348 '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' 1350 1350 ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n', 1351 1351 result … … 1361 1361 'student_id,state,certcode,faccode,depcode,is_postgrad,' 1362 1362 '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,' 1364 1364 '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' 1366 1366 ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n', 1367 1367 result -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r9778 r15203 65 65 studylevelsource = StudyLevelSource().factory 66 66 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, 68 68 400, 410, 420, 500, 510, 520, 600, 610, 620]) 69 69 # All titles do exist 70 70 titles = [studylevelsource.getTitle(studycourse, value) 71 71 for value in values] 72 self.assertEqual(len(titles), 1 8)72 self.assertEqual(len(titles), 19) 73 73 # Unfortunately, unittests don't know about internationalization 74 74 self.assertEqual(studylevelsource.getTitle(studycourse, None), 75 75 'Error: level id ${value} out of range') 76 76 self.assertEqual(studylevelsource.getTitle(studycourse, 0), 77 'Level Zero') 78 self.assertEqual(studylevelsource.getTitle(studycourse, 1), 77 79 'Error: level id ${value} out of range') 78 80 self.assertEqual(studylevelsource.getTitle(studycourse, 10), … … 96 98 self.assertEqual(studylevelsource.getTitle(studycourse, 700), 97 99 'Error: level id ${value} out of range') 98 # Now we modify the certificates to be a pure topre-studies100 # Now we modify the certificates to be a pure pre-studies 99 101 # course 100 102 studycourse.certificate.start_level = 10 101 103 studycourse.certificate.end_level = 10 102 104 values = studylevelsource.getValues(studycourse) 103 self.assertEqual(values, [ 10])105 self.assertEqual(values, [0, 10]) 104 106 titles = [studylevelsource.getTitle(studycourse, value) 105 107 for value in values] 106 self.assertEqual(len(titles), 1)108 self.assertEqual(len(titles), 2) 107 109 self.assertEqual(studylevelsource.getTitle(studycourse, 10), 108 110 'Pre-Studies') … … 115 117 studycourse.certificate.end_level = 200 116 118 values = studylevelsource.getValues(studycourse) 117 self.assertEqual(values, [ 10, 100, 110, 120,119 self.assertEqual(values, [0, 10, 100, 110, 120, 118 120 200, 210, 220, 300, 310, 320]) 119 121 titles = [studylevelsource.getTitle(studycourse, value) 120 122 for value in values] 121 self.assertEqual(len(titles), 1 0)123 self.assertEqual(len(titles), 11) 122 124 # Repeating Pre-Studies level does not exist and raises a KeyError 123 125 # when trying to get its title
Note: See TracChangeset for help on using the changeset viewer.