Changeset 15066 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 28 Jun 2018, 08:24:37 (7 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.