Changeset 15066
- Timestamp:
- 28 Jun 2018, 08:24:37 (6 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r15065 r15066 614 614 def addEntry(self, obj, row, site): 615 615 if IGNORE_MARKER == str(row['level']): 616 raise FatalCSVError(" Invalid level")616 raise FatalCSVError("level: Invalid value") 617 617 parent = self.getParent(row, site) 618 618 parent[str(row['level'])] = obj -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15063 r15066 938 938 # handle_certificate_removed does only clear 939 939 # studycourses with certificate code 'studycourse' but not 940 # 'studycourse_1' or 'studycourse_2'. These certificates do940 # 'studycourse_1' or 'studycourse_2'. These certificates do 941 941 # still exist but have no parents. 942 942 pass … … 951 951 # handle_certificate_removed does only clear 952 952 # studycourses with certificate code 'studycourse' but not 953 # 'studycourse_1' or 'studycourse_2'. These certificates do953 # 'studycourse_1' or 'studycourse_2'. These certificates do 954 954 # still exist but have no parents. 955 955 pass -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studylevel_data.csv
r9296 r15066 6 6 1,,2008,A,111 7 7 1,,2008,A,nonsense 8 1,,2008,A,<IGNORE> 8 9 4,,2008,A,200 9 10 5,,2008,A,200 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r14901 r15066 775 775 num, num_warns, fin_file, fail_file = self.processor.doImport( 776 776 self.csv_file, STUDYLEVEL_HEADER_FIELDS,'create') 777 self.assertEqual(num_warns, 2)777 self.assertEqual(num_warns,3) 778 778 assert self.processor.entryExists( 779 779 dict(reg_number='1', level='100'), self.app) is True … … 784 784 self.assertEqual(studylevel.level_verdict, '0') 785 785 self.assertEqual(studylevel.level, 100) 786 shutil.rmtree(os.path.dirname(fin_file))787 788 786 logcontent = open(self.logfile).read() 789 787 # Logging message from updateEntry, … … 793 791 'level=100, level_verdict=C, level_session=2009' 794 792 in logcontent) 793 content = open(fail_file).read() 794 self.assertEqual( 795 content, 796 'reg_number,level_verdict,level_session,matric_number,level,' 797 '--ERRORS--\r\n' 798 '1,A,2008,<IGNORE>,111,level: Invalid value\r\n' 799 '1,A,2008,<IGNORE>,nonsense,level: Invalid value\r\n' 800 '1,A,2008,<IGNORE>,<IGNORE>,level: Invalid value\r\n' 801 ) 802 shutil.rmtree(os.path.dirname(fin_file)) 795 803 796 804 def test_import_update(self): … … 803 811 num, num_warns, fin_file, fail_file = self.processor.doImport( 804 812 self.csv_file, STUDYLEVEL_HEADER_FIELDS,'update') 805 self.assertEqual(num_warns, 2)813 self.assertEqual(num_warns,3) 806 814 studylevel = self.processor.getEntry( 807 815 dict(reg_number='1', level='100'), self.app) 808 816 self.assertEqual(studylevel.level, 100) 817 content = open(fail_file).read() 818 self.assertEqual( 819 content, 820 'reg_number,level_verdict,level_session,matric_number,level,' 821 '--ERRORS--\r\n' 822 '1,A,2008,<IGNORE>,111,level: Invalid value\r\n' 823 '1,A,2008,<IGNORE>,nonsense,level: Invalid value\r\n' 824 '1,A,2008,<IGNORE>,<IGNORE>,Cannot update: no such entry\r\n' 825 ) 809 826 shutil.rmtree(os.path.dirname(fin_file)) 810 827 … … 820 837 assert self.processor.entryExists( 821 838 dict(reg_number='1', level='100'), self.app) is False 822 self.assertEqual(num_warns, 2)839 self.assertEqual(num_warns,3) 823 840 824 841 shutil.rmtree(os.path.dirname(fin_file))
Note: See TracChangeset for help on using the changeset viewer.