Changeset 9771


Ignore:
Timestamp:
5 Dec 2012, 10:41:11 (12 years ago)
Author:
Henrik Bettermann
Message:

Log payment data after application payment approval.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r9759 r9771  
    669669        success, msg, log = self.context.approveApplicantPayment()
    670670        if log is not None:
    671             self.context.__parent__.writeLogMessage(self, log)
     671            applicant = self.context.__parent__
     672            # Add log message to applicants.log
     673            applicant.writeLogMessage(self, log)
     674            # Add log message to payments.log
     675            self.context.logger.info(
     676                '%s,%s,%s,%s,%s,,,,,,,,,,,,' % (
     677                applicant.applicant_id,
     678                self.context.p_id, self.context.p_category,
     679                self.context.amount_auth, self.context.r_code))
    672680        self.flash(msg)
    673681        return
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r9544 r9771  
    802802        self.assertEqual(payment.r_code, 'AP')
    803803        self.assertTrue(self.applicant.state == 'paid')
     804        # Approval is logged in students.log ...
     805        logfile = os.path.join(
     806            self.app['datacenter'].storage, 'logs', 'applicants.log')
     807        logcontent = open(logfile).read()
     808        self.assertTrue(
     809            'zope.mgr - applicants.browser.OnlinePaymentApprovePage - '
     810            '%s - payment approved' % self.applicant.applicant_id
     811            in logcontent)
     812        # ... and in payments.log
     813        logfile = os.path.join(
     814            self.app['datacenter'].storage, 'logs', 'payments.log')
     815        logcontent = open(logfile).read()
     816        self.assertTrue(
     817            '"zope.mgr",%s,%s,application,200.0,AP,,,,,,,,,,,,\n'
     818            % (self.applicant.applicant_id, payment.p_id)
     819            in logcontent)
    804820        return
    805821
Note: See TracChangeset for help on using the changeset viewer.