Changeset 10570 for main/waeup.fceokene/trunk/src/waeup
- Timestamp:
- 31 Aug 2013, 08:19:05 (11 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/browser.py
r10533 r10570 26 26 PaymentReceiptActionButton, PDFActionButton) 27 27 from waeup.kofa.applicants.pdf import PDFApplicationSlip 28 from waeup.kofa.interfaces import IKofaUtils 29 from waeup.kofa.browser.interfaces import IPDFCreator 28 30 29 31 from kofacustom.nigeria.applicants.browser import ( 30 32 NigeriaExportPDFPaymentSlipPage, NigeriaApplicantManageFormPage, 31 33 NigeriaApplicantDisplayFormPage, NigeriaApplicantEditFormPage) 34 35 from waeup.fceokene.interfaces import MessageFactory as _ 32 36 33 37 from kofacustom.nigeria.applicants.interfaces import ( … … 80 84 def _reduced_slip(self): 81 85 return getattr(self.context, 'result_uploaded', False) 86 87 def _getPDFCreator(self): 88 if 'putme' in self.target or 'pude' in self.target: 89 return getUtility(IPDFCreator, name='ibadan_pdfcreator') 90 return getUtility(IPDFCreator) 91 92 @property 93 def title(self): 94 container_title = self.context.__parent__.title 95 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 96 ar_translation = translate(_('Application Record'), 97 'waeup.kofa', target_language=portal_language) 98 if 'putme' in self.target or 'pude' in self.target: 99 return 'IN AFFILIATION WITH UNIVERSITY OF IBADAN - %s %s %s' % ( 100 container_title, ar_translation, 101 self.context.application_number) 102 return '%s - %s %s' % (container_title, 103 ar_translation, self.context.application_number) 104 82 105 83 106 @property -
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/tests/test_browser.py
r9943 r10570 63 63 self.beccontainer.title = u'This is the bec2011 container' 64 64 self.app['applicants']['bec2011'] = self.beccontainer 65 66 65 delta = datetime.timedelta(days=10) 67 66 self.beccontainer.startdate = datetime.datetime.now(pytz.utc) - delta 68 67 self.beccontainer.enddate = datetime.datetime.now(pytz.utc) + delta 68 69 # Add ug applicants container 70 self.putmecontainer = ApplicantsContainer() 71 self.putmecontainer.mode = 'create' 72 self.putmecontainer.code = u'putme2011' 73 self.putmecontainer.prefix = u'putme' 74 self.putmecontainer.application_category = u'bec' # doesn't matter 75 self.putmecontainer.year = 2011 76 self.putmecontainer.application_fee = 300.0 77 self.putmecontainer.title = u'This is the putme2011 container' 78 self.app['applicants']['putme2011'] = self.putmecontainer 79 delta = datetime.timedelta(days=10) 80 self.putmecontainer.startdate = datetime.datetime.now(pytz.utc) - delta 81 self.putmecontainer.enddate = datetime.datetime.now(pytz.utc) + delta 69 82 70 83 # Populate university … … 91 104 % self.becapplication_number) 92 105 106 putmeapplicant = createObject(u'waeup.Applicant') 107 putmeapplicant.firstname = u'Anna' 108 putmeapplicant.lastname = u'Post' 109 self.app['applicants']['putme2011'].addApplicant(putmeapplicant) 110 self.putmeapplication_number = putmeapplicant.application_number 111 self.putmeapplicant = self.app['applicants']['putme2011'][ 112 self.putmeapplication_number] 113 self.putmeapplicant_path = ('http://localhost/app/applicants/putme2011/%s' 114 % self.putmeapplication_number) 115 93 116 self.browser = Browser() 94 117 self.browser.handleErrors = False … … 110 133 self.browser.getControl(name="form.email").value = 'xx@yy.zz' 111 134 112 def test_manage_and_view_ applicant(self):135 def test_manage_and_view_bec_applicant(self): 113 136 # Managers can manage bec applicants. 114 137 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 125 148 self.assertEqual(self.browser.headers['Status'], '200 Ok') 126 149 return 150 151 def test_manage_and_view_putme_applicant(self): 152 # Managers can manage bec applicants. 153 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 154 self.browser.open(self.putmeapplicant_path) 155 self.assertEqual(self.browser.headers['Status'], '200 Ok') 156 self.assertTrue("'O' Level" in self.browser.contents) 157 self.browser.open(self.putmeapplicant_path + '/manage') 158 self.assertEqual(self.browser.headers['Status'], '200 Ok') 159 self.assertTrue("'O' Level" in self.browser.contents) 160 self.browser.open(self.putmeapplicant_path + '/edit') 161 self.assertEqual(self.browser.headers['Status'], '200 Ok') 162 self.assertTrue("'O' Level" in self.browser.contents) 163 self.browser.open(self.putmeapplicant_path + '/application_slip.pdf') 164 self.assertEqual(self.browser.headers['Status'], '200 Ok') 165 return -
main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py
r9989 r10570 29 29 30 30 APP_CATS_DICT = { 31 'basic': ' PUTME, PUDE, PCE, PRENCE',31 'basic': 'UTME, DE, PCE, PRENCE', 32 32 'no': 'No Application', 33 33 'sandwich': 'Sandwich',
Note: See TracChangeset for help on using the changeset viewer.