Ignore:
Timestamp:
5 Dec 2012, 08:33:04 (12 years ago)
Author:
Henrik Bettermann
Message:

Add log message to payments.log after student payment approval.

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

Legend:

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

    r9758 r9770  
    14811481        success, msg, log = self.context.approveStudentPayment()
    14821482        if log is not None:
     1483            # Add log message to students.log
    14831484            self.context.writeLogMessage(self,log)
     1485            # Add log message to payments.log
     1486            self.context.logger.info(
     1487                '%s,%s,%s,%s,%s,,,,,,,,,,,,' % (
     1488                self.context.student.student_id,
     1489                self.context.p_id, self.context.p_category,
     1490                self.context.amount_auth, self.context.r_code))
    14841491        self.flash(msg)
    14851492        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9760 r9770  
    832832        self.assertMatches('...Payment approved...',
    833833                          self.browser.contents)
    834         # Approval is logged
     834        # Approval is logged in students.log ...
    835835        logfile = os.path.join(
    836836            self.app['datacenter'].storage, 'logs', 'students.log')
     
    839839            'zope.mgr - students.browser.OnlinePaymentApprovePage '
    840840            '- K1000000 - schoolfee payment approved'
     841            in logcontent)
     842        # ... and in payments.log
     843        logfile = os.path.join(
     844            self.app['datacenter'].storage, 'logs', 'payments.log')
     845        logcontent = open(logfile).read()
     846        self.assertTrue(
     847            '"zope.mgr",K1000000,%s,schoolfee,40000.0,AP,,,,,,,,,,,,\n' % value
    841848            in logcontent)
    842849
Note: See TracChangeset for help on using the changeset viewer.