Changeset 13968 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 22 Jun 2016, 04:39:50 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r13224 r13968 41 41 IApplicant, IApplicantEdit, ISpecialApplicant) 42 42 from waeup.kofa.applicants.workflow import application_states_dict 43 from waeup.kofa.applicants.payment import ApplicantOnlinePayment 43 44 44 45 def search(query=None, searchtype=None, view=None): … … 71 72 self.applicant_id = None 72 73 return 74 75 @property 76 def payments(self): 77 payments = [value for value in self.values() 78 if isinstance(value, ApplicantOnlinePayment)] 79 return payments 73 80 74 81 def writeLogMessage(self, view, message): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantdisplaypage.pt
r13886 r13968 54 54 </thead> 55 55 <tbody> 56 <tr tal:repeat="value context/ values">56 <tr tal:repeat="value context/payments"> 57 57 <td> <a tal:attributes="href python:view.url(value)"> 58 58 <span tal:content="value/p_id">PID</span></a></td> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt
r13886 r13968 106 106 </thead> 107 107 <tbody> 108 <tr tal:repeat="cl context/ values">108 <tr tal:repeat="cl context/payments"> 109 109 <td> 110 110 <input type="checkbox" -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
r13952 r13968 201 201 payments = [] 202 202 for applicant in used: 203 for payment in applicant. values():203 for payment in applicant.payments: 204 204 if payment.p_state == 'paid': 205 205 payments.append(payment) … … 215 215 payments = [] 216 216 for applicant in used: 217 for payment in applicant. values():217 for payment in applicant.payments: 218 218 if payment.p_state == 'paid': 219 219 payments.append(payment) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r13216 r13968 34 34 ) 35 35 from waeup.kofa.applicants.interfaces import IApplicant 36 from waeup.kofa.applicants.payment import ApplicantOnlinePayment 36 37 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 37 38 … … 205 206 return 206 207 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 207 218 class ApplicantFactoryTest(FunctionalTestCase): 208 219 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r13951 r13968 1079 1079 self.assertEqual(len(self.special_applicant.keys()), 1) 1080 1080 # The applicant's workflow state is paid ... 1081 self.special_applicant. values()[0].approveApplicantPayment()1081 self.special_applicant.payments[0].approveApplicantPayment() 1082 1082 self.assertEqual(self.special_applicant.state, 'paid') 1083 1083 self.browser.open(applicant_path + '/edit') … … 1094 1094 self.assertEqual(len(self.special_applicant.keys()), 2) 1095 1095 # 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() 1097 1097 self.assertEqual(flashtype, 'success') 1098 1098 self.assertEqual(msg, 'Payment approved') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r13952 r13968 283 283 applicant = self.setup_applicant(self.applicant) 284 284 exporter = ApplicantPaymentExporter() 285 exporter.export(applicant. values(), self.outfile)285 exporter.export(applicant.payments, self.outfile) 286 286 result = open(self.outfile, 'rb').read() 287 287 cdate = str('%s#' % self.applicant['p120'].creation_date)
Note: See TracChangeset for help on using the changeset viewer.