Changeset 8287 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 26 Apr 2012, 14:13:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv
r8284 r8287 1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex, reg_state1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,sex,state 2 2 X666666,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,m,courses validated 3 3 Y777777,Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,m,courses validated -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data_migration.csv
r8284 r8287 1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,sex, reg_state1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,sex,state 2 2 A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,m,clearance started 3 3 B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,m,cleared -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data_update.csv
r8284 r8287 1 reg_number,date_of_birth,matric_number, reg_state1 reg_number,date_of_birth,matric_number,state 2 2 1,1980-01-02,10,admitted 3 3 2,1980-01-03,11, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r8284 r8287 220 220 def test_checkConversion(self): 221 221 errs, inv_errs, conv_dict = self.processor.checkConversion( 222 dict(reg_number='1', reg_state='admitted'))223 self.assertEqual(len(errs),0) 224 # Empty reg_state is allowed225 errs, inv_errs, conv_dict = self.processor.checkConversion( 226 dict(reg_number='1', reg_state=''))227 self.assertEqual(len(errs),0) 228 #self.assertTrue((' reg_state', 'no value provided') in errs)229 errs, inv_errs, conv_dict = self.processor.checkConversion( 230 dict(reg_number='1', reg_state='nonsense'))222 dict(reg_number='1', state='admitted')) 223 self.assertEqual(len(errs),0) 224 # Empty state is allowed 225 errs, inv_errs, conv_dict = self.processor.checkConversion( 226 dict(reg_number='1', state='')) 227 self.assertEqual(len(errs),0) 228 #self.assertTrue(('state', 'no value provided') in errs) 229 errs, inv_errs, conv_dict = self.processor.checkConversion( 230 dict(reg_number='1', state='nonsense')) 231 231 self.assertEqual(len(errs),1) 232 self.assertTrue((' reg_state', 'not allowed') in errs)232 self.assertTrue(('state', 'not allowed') in errs) 233 233 234 234 def test_delEntry(self): … … 254 254 self.csv_file_update, STUDENT_HEADER_FIELDS_UPDATE, 'update') 255 255 self.assertEqual(num_warns,0) 256 # reg_state has changed256 # state has changed 257 257 self.assertEqual(self.app['students']['X666666'].state,'admitted') 258 # reg_state has not changed258 # state has not changed 259 259 self.assertEqual(self.app['students']['Y777777'].state,'courses validated') 260 260 shutil.rmtree(os.path.dirname(fin_file)) … … 301 301 self.assertEqual( 302 302 content, 303 'reg_number,firstname,student_id,sex,email,phone, date_of_birth,reg_state,lastname,password,matric_number,--ERRORS--\r\n'304 '4,John,D123456,m,aa@aa.ng,1234, 1990-01-05,nonsense,Wolter,mypw1,100003,reg_state: not allowed\r\n'305 '5,John,E123456,x,aa@aa.ng,1234, 1990-01-06,,Kennedy,,100004,sex: Invalid value\r\n'303 'reg_number,firstname,student_id,sex,email,phone,state,date_of_birth,lastname,password,matric_number,--ERRORS--\r\n' 304 '4,John,D123456,m,aa@aa.ng,1234,nonsense,1990-01-05,Wolter,mypw1,100003,state: not allowed\r\n' 305 '5,John,E123456,x,aa@aa.ng,1234,,1990-01-06,Kennedy,,100004,sex: Invalid value\r\n' 306 306 ) 307 307 self.assertTrue('A123456' in self.app['students'].keys()) … … 317 317 self.assertTrue( 318 318 "State 'clearance started' set by system" in history) 319 # reg_state was empty and student is thus in state created319 # state was empty and student is thus in state created 320 320 self.assertEqual(self.app['students']['F123456'].state,'created') 321 321 shutil.rmtree(os.path.dirname(fin_file))
Note: See TracChangeset for help on using the changeset viewer.