Changeset 9420 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 25 Oct 2012, 21:52:10 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv
r7665 r9420 1 reg_number,matric_number,level,code,score,mandatory 2 1,,100,COURSE1,1,True 3 2,,100,COURSE1,2,False 4 ,100002,100,COURSE1,3,False 5 1,,nonsense,COURSE1,5, 6 1,,100,NONSENSE,5, 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,,nonsense,COURSE1,5,, 6 1,,100,NONSENSE,5,, 7 1,,200,COURSE1,6,,2004 8 1,,300,COURSE1,6,,2008 9 1,,300,COURSE1,6,,200888 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r9302 r9420 733 733 734 734 def test_import(self): 735 736 735 num, num_warns, fin_file, fail_file = self.processor.doImport( 737 736 self.csv_file, COURSETICKET_HEADER_FIELDS,'create') 738 739 self.assertEqual(num_warns,2) 737 fail_file = open(fail_file).read() 738 self.assertEqual(num_warns,5) 739 self.assertEqual(fail_file, 740 'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n' 741 '1,COURSE1,,nonsense,,5,,Not all parents do exist yet. Skipping\r\n' 742 '1,NONSENSE,,100,,5,,code: non-existent\r\n' 743 '1,COURSE1,,200,2004,6,,level_session: does not match 2008\r\n' 744 '1,COURSE1,,300,2008,6,,level: does not exist\r\n' 745 '1,COURSE1,,300,200888,6,,level_session: Invalid value; level: does not exist\r\n') 740 746 assert self.processor.entryExists( 741 747 dict(reg_number='1', level='100', code='COURSE1'), … … 772 778 num, num_warns, fin_file, fail_file = self.processor.doImport( 773 779 self.csv_file, COURSETICKET_HEADER_FIELDS,'update') 774 self.assertEqual(num_warns,2) 780 fail_file = open(fail_file).read() 781 self.assertEqual(num_warns,5) 782 self.assertEqual(fail_file, 783 'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n' 784 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n' 785 '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n' 786 '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n' 787 '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level: does not exist\r\n' 788 '1,COURSE1,<IGNORE>,300,200888,6,<IGNORE>,level_session: Invalid value; level: does not exist\r\n') 775 789 shutil.rmtree(os.path.dirname(fin_file)) 776 790 … … 786 800 num, num_warns, fin_file, fail_file = self.processor.doImport( 787 801 self.csv_file, COURSETICKET_HEADER_FIELDS,'remove') 788 self.assertEqual(num_warns, 2)802 self.assertEqual(num_warns,5) 789 803 assert self.processor.entryExists( 790 804 dict(reg_number='1', level='100', code='COURSE1'), self.app) is False -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9412 r9420 161 161 self.certificate.school_fee_1 = 40000.0 162 162 self.certificate.school_fee_2 = 20000.0 163 self.app['faculties']['fac1'] = Faculty(code= 'fac1')164 self.app['faculties']['fac1']['dep1'] = Department(code= 'dep1')163 self.app['faculties']['fac1'] = Faculty(code=u'fac1') 164 self.app['faculties']['fac1']['dep1'] = Department(code=u'dep1') 165 165 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 166 166 self.certificate)
Note: See TracChangeset for help on using the changeset viewer.