- Timestamp:
- 21 Dec 2015, 21:41:28 (9 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r13557 r13558 33 33 from waeup.kofa.applicants.interfaces import ( 34 34 ISpecialApplicant, IApplicantsUtils) 35 from waeup.kofa.browser.interfaces import IPDFCreator 35 36 from kofacustom.nigeria.applicants.browser import ( 36 37 NigeriaApplicantDisplayFormPage, … … 275 276 class CustomPDFApplicationSlip(NigeriaPDFApplicationSlip): 276 277 278 def _getPDFCreator(self): 279 if 'afak' in self.target: 280 return getUtility(IPDFCreator, name='akoka_pdfcreator') 281 return getUtility(IPDFCreator) 282 277 283 @property 278 284 def title(self): -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests/test_browser.py
r13557 r13558 164 164 return 165 165 166 def test_asaba_application_slip(self): 167 168 # Remove required FieldProperty attribute first ... 169 delattr(ApplicantsContainer, 'prefix') 170 # ... and replace by asaba 171 self.applicantscontainer.prefix = 'afas' 166 def test_application_slip(self): 167 172 168 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 173 169 self.slip_path = self.view_path + '/application_slip.pdf' … … 185 181 open(path, 'wb').write(self.browser.contents) 186 182 print "Sample application_slip.pdf written to %s" % path 183 184 def test_akoka_application_slip(self): 185 186 # Remove required FieldProperty attribute first ... 187 delattr(ApplicantsContainer, 'prefix') 188 # ... and replace by akoka 189 self.applicantscontainer.prefix = 'afak' 190 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 191 self.slip_path = self.view_path + '/application_slip.pdf' 192 self.browser.open(self.manage_path) 193 self.assertEqual(self.browser.headers['Status'], '200 Ok') 194 self.fill_correct_values() 195 self.browser.getControl("Save").click() 196 IWorkflowState(self.applicant).setState('submitted') 197 self.browser.open(self.manage_path) 198 self.browser.getLink("Download application slip").click() 199 self.assertEqual(self.browser.headers['Status'], '200 Ok') 200 self.assertEqual(self.browser.headers['Content-Type'], 201 'application/pdf') 202 path = os.path.join(samples_dir(), 'akoka_application_slip.pdf') 203 open(path, 'wb').write(self.browser.contents) 204 print "Sample akoka_application_slip.pdf written to %s" % path -
main/waeup.uniben/trunk/src/waeup/uniben/browser/pdf.py
r8204 r13558 21 21 22 22 import os 23 import grok 23 24 from waeup.kofa.browser.pdf import PDFCreator 24 25 … … 34 35 watermark_pos = [-25, 100] 35 36 logo_pos = [507, 720, 40] 37 38 39 class AkokaPDFCreator(PDFCreator): 40 41 grok.name('akoka_pdfcreator') 42 43 watermark_path = os.path.join( 44 os.path.dirname(__file__), 'static', 'pdf_watermark.jpg') 45 46 watermark_pos = [-25, 100] 47 48 # right (default) logo 49 header_logo_path = os.path.join( 50 os.path.dirname(__file__), 'static', 'pdf_logo.jpg') 51 52 logo_pos = [507, 720, 40] 53 54 # left logo 55 header_logo_left_path = os.path.join( 56 os.path.dirname(__file__), 'static', 'pdf_logo_akoka.jpg') 57 58 logo_left_pos = [50, 680, 30]
Note: See TracChangeset for help on using the changeset viewer.