Changeset 7273 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 4 Dec 2011, 21:08:53 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py
r7269 r7273 61 61 62 62 STUDYCOURSE_HEADER_FIELDS = STUDYCOURSE_SAMPLE_DATA.split( 63 '\n')[0].split(',') 64 65 STUDENT_SAMPLE_DATA_MIGRATION = open( 66 os.path.join(os.path.dirname(__file__), 'sample_student_data_migration.csv'), 67 'rb').read() 68 69 STUDENT_HEADER_FIELDS_MIGRATION = STUDENT_SAMPLE_DATA_MIGRATION.split( 63 70 '\n')[0].split(',') 64 71 … … 98 105 self.csv_file_update2 = os.path.join( 99 106 self.workdir, 'sample_student_data_update2.csv') 107 self.csv_file_migration = os.path.join( 108 self.workdir, 'sample_student_data_migration.csv') 100 109 open(self.csv_file, 'wb').write(STUDENT_SAMPLE_DATA) 101 110 open(self.csv_file_update, 'wb').write(STUDENT_SAMPLE_DATA_UPDATE) 102 111 open(self.csv_file_update2, 'wb').write(STUDENT_SAMPLE_DATA_UPDATE2) 112 open(self.csv_file_migration, 'wb').write(STUDENT_SAMPLE_DATA_MIGRATION) 103 113 104 114 def tearDown(self): … … 180 190 self.csv_file_update, STUDENT_HEADER_FIELDS_UPDATE, 'remove') 181 191 self.assertEqual(num_warns,0) 192 shutil.rmtree(os.path.dirname(fin_file)) 193 194 def test_import_migration_data(self): 195 num, num_warns, fin_file, fail_file = self.importer.doImport( 196 self.csv_file_migration, STUDENT_HEADER_FIELDS_MIGRATION) 197 self.assertEqual(num_warns,0) 198 assert len(self.app['students'].keys()) == 4 199 self.assertTrue('A123456' in self.app['students'].keys()) 182 200 shutil.rmtree(os.path.dirname(fin_file)) 183 201 -
main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py
r7196 r7273 300 300 continue 301 301 obj = self.callFactory() 302 self.updateEntry(obj, row, site) 302 # Override all values in row, also 303 # student_ids and applicant_ids which have been 304 # generated in the respective __init__ methods before. 305 self.updateEntry(obj, row, site) 303 306 try: 304 307 self.addEntry(obj, row, site)
Note: See TracChangeset for help on using the changeset viewer.