Changeset 8331 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 3 May 2012, 07:28:57 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data_update.csv
r8290 r8331 1 container_code,reg_number,firstname,middlename,state2 dp2011,1001,Aaren,,3 dp2011 ,1002,Alfons,,admitted4 dp2011,1003,Abraham,,1 applicant_id,reg_number,firstname,middlename,state 2 ,1001,Aaren,, 3 dp2011_2345,6666,Alfons,,admitted 4 ,1003,Abraham,, -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data_update2.csv
r8290 r8331 1 container_code,reg_number,firstname,middlename,application_number 2 dp2011 ,1001,Aaren,XXX,3 dp2011,1002,Alfons,XXX, 4 dp2011,1003,Abraham,XXX, 1 applicant_id,reg_number,firstname,middlename 2 dp2011_1234,,Aaren,XXX 3 ,6666,Alfons,XXX 4 ,1003,Abraham,XXX -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r8311 r8331 24 24 import tempfile 25 25 import unittest 26 import grok 26 27 from zope.component.hooks import setSite, clearSite 27 28 from zope.component import createObject 28 29 from zope.interface.verify import verifyClass, verifyObject 30 from zope.event import notify 29 31 30 32 from waeup.kofa.app import University … … 68 70 69 71 APPLICANT_HEADER_FIELDS_UPDATE = APPLICANT_SAMPLE_DATA_UPDATE.split( 72 '\n')[0].split(',') 73 74 APPLICANT_HEADER_FIELDS_UPDATE2 = APPLICANT_SAMPLE_DATA_UPDATE2.split( 70 75 '\n')[0].split(',') 71 76 … … 310 315 num, num_warns, fin_file, fail_file = self.processor.doImport( 311 316 self.csv_file_update, APPLICANT_HEADER_FIELDS_UPDATE, 'update') 312 #content = open(fail_file).read()313 317 self.assertEqual(num_warns,0) 314 318 # The middlename import value was None. … … 324 328 # password of Finau is still unset 325 329 self.assertEqual(IUserAccount(container['2345']).password,'') 326 shutil.rmtree(os.path.dirname(fin_file)) 327 # Now we import another file which clears all middlename attributes. 328 num, num_warns, fin_file, fail_file = self.processor.doImport( 329 self.csv_file_update2, APPLICANT_HEADER_FIELDS_UPDATE, 'update') 330 # reg_number of Finau has changed 331 self.assertEqual(container['2345'].reg_number, '6666') 332 shutil.rmtree(os.path.dirname(fin_file)) 333 # We have to inform the catalog that the reg_number has changed 334 notify(grok.ObjectModifiedEvent(container['2345'])) 335 # Now we import another file which clears all middlename attributes 336 # and uses the new reg_number as locator 337 num, num_warns, fin_file, fail_file = self.processor.doImport( 338 self.csv_file_update2, APPLICANT_HEADER_FIELDS_UPDATE2, 'update') 339 #content = open(fail_file).read() 340 #print content 330 341 self.assertEqual(num_warns,0) 331 342 assert container['1234'].middlename is None
Note: See TracChangeset for help on using the changeset viewer.