Ignore:
Timestamp:
22 Jun 2016, 04:39:50 (9 years ago)
Author:
Henrik Bettermann
Message:

Make provision against storing other objects than applicant payments in applicant containers.

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/test_applicant.py

    r13216 r13968  
    3434    )
    3535from waeup.kofa.applicants.interfaces import IApplicant
     36from waeup.kofa.applicants.payment import ApplicantOnlinePayment
    3637from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer
    3738
     
    205206        return
    206207
     208    def test_payments(self):
     209        payment = ApplicantOnlinePayment()
     210        no_payment = object()
     211        self.applicant['pid'] = payment
     212        self.applicant['nopid'] = no_payment
     213        self.assertEqual(len(self.applicant.values()),2)
     214        self.assertEqual(len(self.applicant.payments),1)
     215        self.assertEqual(self.applicant.payments[0],payment)
     216        return
     217
    207218class ApplicantFactoryTest(FunctionalTestCase):
    208219
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r13951 r13968  
    10791079        self.assertEqual(len(self.special_applicant.keys()), 1)
    10801080        # The applicant's workflow state is paid ...
    1081         self.special_applicant.values()[0].approveApplicantPayment()
     1081        self.special_applicant.payments[0].approveApplicantPayment()
    10821082        self.assertEqual(self.special_applicant.state, 'paid')
    10831083        self.browser.open(applicant_path + '/edit')
     
    10941094        self.assertEqual(len(self.special_applicant.keys()), 2)
    10951095        # Second payment can also be approved wthout error message
    1096         flashtype, msg, log = self.special_applicant.values()[1].approveApplicantPayment()
     1096        flashtype, msg, log = self.special_applicant.payments[1].approveApplicantPayment()
    10971097        self.assertEqual(flashtype, 'success')
    10981098        self.assertEqual(msg, 'Payment approved')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r13952 r13968  
    283283        applicant = self.setup_applicant(self.applicant)
    284284        exporter = ApplicantPaymentExporter()
    285         exporter.export(applicant.values(), self.outfile)
     285        exporter.export(applicant.payments, self.outfile)
    286286        result = open(self.outfile, 'rb').read()
    287287        cdate = str('%s#' % self.applicant['p120'].creation_date)
Note: See TracChangeset for help on using the changeset viewer.