Changeset 13974 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 22 Jun 2016, 13:19:20 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r13968 r13974 42 42 from waeup.kofa.applicants.workflow import application_states_dict 43 43 from waeup.kofa.applicants.payment import ApplicantOnlinePayment 44 from waeup.kofa.applicants.refereereport import ApplicantRefereeReport 44 45 45 46 def search(query=None, searchtype=None, view=None): … … 78 79 if isinstance(value, ApplicantOnlinePayment)] 79 80 return payments 81 82 @property 83 def refereereports(self): 84 reports = [value for value in self.values() 85 if isinstance(value, ApplicantRefereeReport)] 86 return reports 80 87 81 88 def writeLogMessage(self, view, message): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r13968 r13974 35 35 from waeup.kofa.applicants.interfaces import IApplicant 36 36 from waeup.kofa.applicants.payment import ApplicantOnlinePayment 37 from waeup.kofa.applicants.refereereport import ApplicantRefereeReport 37 38 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 38 39 … … 208 209 def test_payments(self): 209 210 payment = ApplicantOnlinePayment() 210 no_payment = object()211 no_payment = ApplicantRefereeReport() 211 212 self.applicant['pid'] = payment 212 213 self.applicant['nopid'] = no_payment 213 214 self.assertEqual(len(self.applicant.values()),2) 214 215 self.assertEqual(len(self.applicant.payments),1) 215 self.assertEqual(self.applicant.payments[0],payment) 216 self.assertEqual(self.applicant.payments[0], payment) 217 return 218 219 def test_refereereports(self): 220 report = ApplicantRefereeReport() 221 no_report = ApplicantOnlinePayment() 222 self.applicant['rid'] = report 223 self.applicant['norid'] = no_report 224 self.assertEqual(len(self.applicant.values()),2) 225 self.assertEqual(len(self.applicant.refereereports),1) 226 self.assertEqual(self.applicant.refereereports[0], report) 216 227 return 217 228
Note: See TracChangeset for help on using the changeset viewer.