- Timestamp:
- 18 Aug 2017, 06:43:53 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r13873 r14804 530 530 num, num_warns, fin_file, fail_file = self.processor.doImport( 531 531 self.csv_file, PAYMENT_HEADER_FIELDS,'create') 532 self.assertEqual(num_warns, 1)532 self.assertEqual(num_warns,2) 533 533 fail_file = open(fail_file).read() 534 534 self.assertTrue('Payment has already been made' in fail_file) … … 538 538 num, num_warns, fin_file, fail_file = self.processor.doImport( 539 539 self.csv_file, PAYMENT_HEADER_FIELDS,'create') 540 # Both records can be imported now. 540 541 self.assertEqual(num_warns,0) 542 # One with imported and known p_id ... 541 543 payment = self.processor.getEntry(dict(applicant_id='dp2011_1234', 542 544 p_id='p1266236341955'), self.app) … … 548 550 self.assertEqual(cdate, '2010-11-25 21:16:33') 549 551 self.assertEqual(str(payment.creation_date.tzinfo),'UTC') 552 # ... the other one with generated p_id. 553 p_id_failed = self.applicant2.keys()[1] 554 payment_failed = self.processor.getEntry(dict(applicant_id='dp2011_1234', 555 p_id=p_id_failed), self.app) 556 self.assertEqual(payment_failed.p_state, 'failed') 557 self.assertEqual(payment_failed.amount_auth, 10500.1) 550 558 shutil.rmtree(os.path.dirname(fin_file)) 551 559 logcontent = open(self.logfile).read() … … 553 561 self.assertTrue( 554 562 'INFO - system - ApplicantOnlinePayment Processor - dp2011_1234 - ' 555 'previous update cancelled' 556 in logcontent) 563 'previous update cancelled' in logcontent) 557 564 self.assertTrue( 558 565 'INFO - system - ApplicantOnlinePayment Processor - ' … … 560 567 'creation_date=2010-11-25 21:16:33.757000+00:00, ' 561 568 'r_amount_approved=19500.1, p_category=application, ' 562 'amount_auth=19500.1, p_session=2015, p_state=paid' 563 in logcontent) 569 'amount_auth=19500.1, p_session=2015, p_state=paid' in logcontent) 570 self.assertTrue( 571 'INFO - system - ApplicantOnlinePayment Processor - ' 572 'sample_payment_data - dp2011_1234 - updated: p_id=%s, ' 573 'creation_date=2011-11-25 21:16:33.757000+00:00, ' 574 'r_amount_approved=19500.1, p_category=application, ' 575 'amount_auth=10500.1, p_session=2016, p_state=failed' 576 % p_id_failed in logcontent)
Note: See TracChangeset for help on using the changeset viewer.