Changeset 8334 for main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
- Timestamp:
- 3 May 2012, 20:43:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r8332 r8334 245 245 open(self.csv_file_update2, 'wb').write(APPLICANT_SAMPLE_DATA_UPDATE2) 246 246 247 self.logfile = os.path.join( 248 self.app['datacenter'].storage, 'logs', 'applicants.log') 249 247 250 def test_interface(self): 248 251 # Make sure we fulfill the interface contracts. … … 289 292 assert applicant.__implemented__.__name__ == ( 290 293 'waeup.kofa.applicants.applicant.Applicant') 294 logcontent = open(self.logfile).read() 295 # Logging message from updateEntry, 296 # create applicant with given application_number 297 self.assertTrue( 298 'Applicant imported: applicant_id=dp2011_1234, password=mypwd1, ' 299 'reg_number=1001, firstname=Aaren, middlename=Peter, lastname=Pieri, ' 300 'sex=m, course1=CERT1, date_of_birth=1990-01-02, email=xx@yy.zz' in 301 logcontent) 302 # create applicant with random application_number which is 303 # not shown in the log file 304 self.assertTrue( 305 'Applicant imported: reg_number=1003, firstname=Aaren, ' 306 'middlename=Alfons, lastname=Berson, sex=m, course1=CERT1, ' 307 'date_of_birth=1990-01-04, email=xx@yy.zz' in 308 logcontent) 291 309 shutil.rmtree(os.path.dirname(fin_file)) 292 310 … … 327 345 self.assertTrue(IUserAccount(container['1234']).checkPassword('mypwd1')) 328 346 # password of Finau is still unset 329 self.assertEqual(IUserAccount(container['2345']).password, '')347 self.assertEqual(IUserAccount(container['2345']).password,None) 330 348 # reg_number of Finau has changed 331 349 self.assertEqual(container['2345'].reg_number, '6666') 350 logcontent = open(self.logfile).read() 351 352 # Logging message from updateEntry, 353 # reg_number is locator 354 self.assertTrue( 355 'Applicant updated: reg_number=1001, firstname=Aaren' in 356 logcontent) 357 # applicant_id is locator 358 self.assertTrue( 359 'Applicant updated: state=admitted, reg_number=6666, ' 360 'firstname=Alfons, applicant_id=dp2011_2345' in 361 logcontent) 362 332 363 shutil.rmtree(os.path.dirname(fin_file)) 333 364 … … 350 381 self.csv_file_update, APPLICANT_HEADER_FIELDS_UPDATE, 'remove') 351 382 self.assertEqual(num_warns,0) 352 shutil.rmtree(os.path.dirname(fin_file)) 383 logcontent = open(self.logfile).read() 384 385 # Logging message from handle_applicant_transition_event 386 self.assertTrue( 387 'dp2011_1234 - Applicant record removed' in 388 logcontent) 389 390 shutil.rmtree(os.path.dirname(fin_file))
Note: See TracChangeset for help on using the changeset viewer.