Changeset 9333 for main/waeup.kofa/trunk/src/waeup/kofa/university/tests
- Timestamp:
- 14 Oct 2012, 04:54:11 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/university/tests
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
r9293 r9333 72 72 73 73 COURSE_HEADER_FIELDS = COURSE_SAMPLE_DATA.split( 74 '\n')[0].split(',') 75 76 COURSE_SAMPLE_DATA_UPDATE = open( 77 os.path.join(os.path.dirname(__file__), 'sample_course_data_update.csv'), 78 'rb').read() 79 80 COURSE_HEADER_FIELDS_UPDATE = COURSE_SAMPLE_DATA_UPDATE.split( 74 81 '\n')[0].split(',') 75 82 … … 441 448 self.row4 = dict(department_code='DEP1', faculty_code='FAC1', code="CRS1") 442 449 443 self.csv_file_course = os.path.join(self.workdir, 'sample_course_data.csv') 450 self.csv_file_course = os.path.join( 451 self.workdir, 'sample_course_data.csv') 444 452 open(self.csv_file_course, 'wb').write(COURSE_SAMPLE_DATA) 453 self.csv_file_course_update = os.path.join( 454 self.workdir, 'sample_course_data_update.csv') 455 open(self.csv_file_course_update, 'wb').write(COURSE_SAMPLE_DATA_UPDATE) 445 456 return 446 457 … … 513 524 self.assertEqual(user_name, 'anne') 514 525 self.assertEqual(local_role, 'waeup.local.Lecturer') 526 shutil.rmtree(os.path.dirname(fin_file)) 527 return 528 529 def test_import_update(self): 530 num, num_warns, fin_file, fail_file = self.proc.doImport( 531 self.csv_file_course, COURSE_HEADER_FIELDS) 532 shutil.rmtree(os.path.dirname(fin_file)) 533 num, num_warns, fin_file, fail_file = self.proc.doImport( 534 self.csv_file_course_update, COURSE_HEADER_FIELDS_UPDATE, 'update') 535 self.assertEqual(num_warns,0) 536 self.assertEqual( 537 self.app['faculties']['FAC1']['DEP1'].courses['CRS2'].title, 538 'New Title') 515 539 shutil.rmtree(os.path.dirname(fin_file)) 516 540 return
Note: See TracChangeset for help on using the changeset viewer.