Changeset 14197
- Timestamp:
- 28 Sep 2016, 07:04:12 (8 years ago)
- Location:
- main/ikobacustom.uniben/trunk/src/ikobacustom/uniben
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/batching.py
r14184 r14197 24 24 from ikobacustom.uniben.customers.interfaces import ( 25 25 IUnibenCustomer, 26 IUnibenCustomerDocument, IRIAAContract) 26 IUnibenCustomerPDFDocument, IUnibenCustomerJPGDocument, 27 IRIAAContract) 27 28 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 29 … … 43 44 grok.name(util_name) 44 45 name = _('Uniben Customer PDF Document Processor') 45 iface = IUnibenCustomer Document46 iface = IUnibenCustomerPDFDocument 46 47 factory_name = 'waeup.UnibenCustomerPDFDocument' 48 49 50 class UnibenCustomerJPGDocumentProcessor(CustomerDocumentProcessorBase): 51 """A batch processor for IUnibenCustomerDocument objects. 52 """ 53 util_name = 'unibencustomerjpgdocumentprocessor' 54 grok.name(util_name) 55 name = _('Uniben Customer JPG Document Processor') 56 iface = IUnibenCustomerJPGDocument 57 factory_name = 'waeup.UnibenCustomerJPGDocument' 47 58 48 59 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/documents.py
r14184 r14197 27 27 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 28 from ikobacustom.uniben.customers.interfaces import ( 29 IUnibenCustomerDocument, IUnibenCustomerPDFDocument) 29 IUnibenCustomerPDFDocument, 30 IUnibenCustomerJPGDocument) 30 31 31 32 class UnibenCustomerDocument(CustomerDocumentBase): 33 """This is a sample customer document. 32 class UnibenCustomerJPGDocument(CustomerDocumentBase): 33 """This is a customer jpg document. 34 34 """ 35 35 36 grok.implements(IUnibenCustomer Document, ICustomerNavigation)37 grok.provides(IUnibenCustomer Document)36 grok.implements(IUnibenCustomerJPGDocument, ICustomerNavigation) 37 grok.provides(IUnibenCustomerJPGDocument) 38 38 39 39 # Ikoba can store any number of files per Document object. … … 41 41 # only one file per Document object. Thus the following 42 42 # tuple should contain only a single filename string. 43 filenames = ('scan ',)43 filenames = ('scan.jpg',) 44 44 45 form_fields_interface = IUnibenCustomer Document45 form_fields_interface = IUnibenCustomerJPGDocument 46 46 47 UnibenCustomer Document = attrs_to_fields(UnibenCustomerDocument)47 UnibenCustomerJPGDocument = attrs_to_fields(UnibenCustomerJPGDocument) 48 48 49 49 50 # Customer documents must be importable. So we need a factory. 51 class UnibenCustomerDocumentFactory(grok.GlobalUtility): 52 """A factory for customer documents. 50 class UnibenCustomerJPGDocumentFactory(grok.GlobalUtility): 51 """A factory for customer jpg documents. 53 52 """ 54 53 grok.implements(IFactory) 55 grok.name(u'waeup.UnibenCustomer Document')54 grok.name(u'waeup.UnibenCustomerJPGDocument') 56 55 title = u"Create a new document.", 57 description = u"This factory instantiates new sampledocument instances."56 description = u"This factory instantiates new document instances." 58 57 59 58 def __call__(self, *args, **kw): 60 return UnibenCustomer Document(*args, **kw)59 return UnibenCustomerJPGDocument(*args, **kw) 61 60 62 61 def getInterfaces(self): 63 return implementedBy(UnibenCustomerDocument) 62 return implementedBy(UnibenCustomerJPGDocument) 63 64 64 65 65 class UnibenCustomerPDFDocument(CustomerDocumentBase): -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/export.py
r14184 r14197 22 22 CustomerExporter, CustomerDocumentExporterBase, ContractExporterBase) 23 23 from ikobacustom.uniben.customers.interfaces import ( 24 IUnibenCustomer, IUnibenCustomer Document, IRIAAContractProcess,24 IUnibenCustomer, IUnibenCustomerJPGDocument, IRIAAContractProcess, 25 25 IUnibenCustomerPDFDocument) 26 26 from ikobacustom.uniben.interfaces import MessageFactory as _ … … 42 42 43 43 44 class UnibenCustomerJPGDocumentExporter(CustomerDocumentExporterBase): 45 """Exporter for documents. 46 """ 47 grok.name('unibencustomerjpgdocuments') 48 iface = IUnibenCustomerJPGDocument 49 title = _(u'Uniben Customer JPG Documents') 50 class_name = 'UnibenCustomerJPGDocument' 51 52 44 53 class RIAAContractExporter(ContractExporterBase): 45 54 """Exporter for Contract instances. -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/fileviewlets.py
r14184 r14197 24 24 25 25 from ikobacustom.uniben.customers.documents import ( 26 UnibenCustomerDocument, UnibenCustomerPDFDocument) 26 UnibenCustomerPDFDocument, 27 UnibenCustomerJPGDocument) 27 28 28 29 from waeup.ikoba.customers.browser import ( … … 36 37 # File viewlets for customer documents 37 38 38 class SampleScanManageUpload(FileUpload):39 class JPGScanManageUpload(FileUpload): 39 40 """Scan upload viewlet for officers. 40 41 """ 41 42 grok.order(1) 42 grok.context(UnibenCustomer Document)43 grok.context(UnibenCustomerJPGDocument) 43 44 grok.view(DocumentManageFormPage) 44 45 grok.require('waeup.manageCustomer') 45 label = _(u' Sample Scan')46 title = _(u' Sample Scan')46 label = _(u'JPG File') 47 title = _(u'JPG File') 47 48 mus = 1024 * 200 48 download_name = u'sample' 49 download_filename = download_name 49 download_name = u'scan.jpg' 50 50 tab_redirect = '#tab2' 51 51 52 @property 53 def download_filename(self): 54 return u"%s.jpg" % self.context.document_id[:9] 52 55 53 class SampleScanEditUpload(SampleScanManageUpload): 56 57 class JPGScanEditUpload(JPGScanManageUpload): 54 58 """Scan upload viewlet for customer. 55 59 """ … … 58 62 59 63 60 class SampleScanDisplay(FileDisplay):64 class JPGScanDisplay(FileDisplay): 61 65 """Scan display viewlet. 62 66 """ 63 67 grok.order(1) 64 grok.context(UnibenCustomer Document)68 grok.context(UnibenCustomerJPGDocument) 65 69 grok.require('waeup.viewCustomer') 66 70 grok.view(DocumentDisplayFormPage) 67 label = _(u'Sample Scan') 68 title = _(u'Sample Scan') 69 download_name = u'sample' 70 download_filename = download_name 71 label = _(u'JPG File') 72 title = _(u'JPG File') 73 download_name = u'scan.jpg' 74 75 @property 76 def download_filename(self): 77 return u"%s.jpg" % self.context.document_id[:9] 71 78 72 79 73 class SampleScanImage(Image):80 class JPGScanImage(Image): 74 81 """Scan document. 75 82 """ 76 grok.name('s ample')77 grok.context(UnibenCustomer Document)83 grok.name('scan.jpg') 84 grok.context(UnibenCustomerJPGDocument) 78 85 grok.require('waeup.viewCustomer') 79 download_name = u'sample' 80 download_filename = download_name 86 download_name = u'scan.jpg' 81 87 88 @property 89 def download_filename(self): 90 return u"%s.jpg" % self.context.document_id[:9] 82 91 83 class SampleScanPDFSlip(SampleScanDisplay):92 class JPGScanPDFSlip(JPGScanDisplay): 84 93 grok.view(PDFDocumentSlip) 94 85 95 86 96 class PDFScanManageUpload(FileUpload): … … 115 125 grok.require('waeup.viewCustomer') 116 126 grok.view(DocumentDisplayFormPage) 117 label = _(u'PDF Scan')118 title = _(u'PDF Scan')127 label = _(u'PDF File') 128 title = _(u'PDF File') 119 129 download_name = u'scan.pdf' 120 130 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/interfaces.py
r14191 r14197 17 17 ## 18 18 19 import re 19 20 from zope import schema 20 21 from waeup.ikoba.interfaces import IIkobaObject 21 from waeup.ikoba.schema import FormattedDate 22 from waeup.ikoba.schema import FormattedDate, PhoneNumber 22 23 from waeup.ikoba.customers.interfaces import ( 23 24 ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract) … … 27 28 from ikobacustom.uniben.interfaces import MessageFactory as _ 28 29 30 class NotUnibenEmailAddress(schema.ValidationError): 31 __doc__ = u"Invalid Uniben email address" 32 33 check_email = re.compile( 34 r"^[^@\s,]+@[^@\.\s,]+(\.[^@\.\s,]+)*$").match 35 36 def validate_uniben_email(value): 37 if not check_email(value): 38 raise NotUnibenEmailAddress(value) 39 if not value.endswith('uniben.edu'): 40 raise NotUnibenEmailAddress(value) 41 return True 29 42 30 43 class IUnibenCustomer(ICustomer): … … 36 49 37 50 38 class IUnibenCustomer Document(ICustomerDocument):51 class IUnibenCustomerJPGDocument(ICustomerDocument): 39 52 """A customer document. 40 53 … … 53 66 """ 54 67 55 title_rank = schema.TextLine(68 nominator_title_rank = schema.TextLine( 56 69 title = _(u'Title/Rank'), 57 70 required = False, 58 71 ) 59 72 60 department = schema.TextLine( 61 title = _(u'Department/Faculty/Institute'), 62 required = False, 63 ) 64 65 date_of_birth = FormattedDate( 66 title = _(u'Date of Birth'), 67 required = False, 68 show_year = True, 69 ) 70 71 nationality = schema.Choice( 73 nominator_nationality = schema.Choice( 72 74 vocabulary = nats_vocab, 73 75 title = _(u'Current Nationality'), … … 75 77 ) 76 78 77 address = schema.Text(79 nominator_address = schema.Text( 78 80 title = _(u'Affiliation/Address'), 81 required = False, 82 ) 83 84 nominee_fullname = schema.TextLine( 85 title = _(u'Name'), 86 description = u'Surname last and in capital letters', 87 required = False, 88 ) 89 90 nominee_title_rank = schema.TextLine( 91 title = _(u'Title/Rank'), 92 required = False, 93 ) 94 95 nominee_department = schema.TextLine( 96 title = _(u'Department/Faculty/Institute'), 97 required = False, 98 ) 99 100 nominee_date_of_birth = FormattedDate( 101 title = _(u'Date of Birth'), 102 required = False, 103 show_year = True, 104 ) 105 106 nominee_nationality = schema.Choice( 107 vocabulary = nats_vocab, 108 title = _(u'Current Nationality'), 109 required = False, 110 ) 111 112 nominee_email = schema.ASCIILine( 113 title = _(u'Uniben Email Address'), 114 required = True, 115 constraint=validate_uniben_email, 116 ) 117 118 nominee_phone = PhoneNumber( 119 title = _(u'Phone'), 120 description = u'', 79 121 required = False, 80 122 ) … … 131 173 ) 132 174 133 vitae = schema.Text(134 title = _(u'Curriculum Vitae'),135 description = u'A curriculum vitae including a full list of scholarly '136 'publications',137 required = False,138 )139 140 175 prev_aw = schema.Text( 141 176 title = _(u'Previous Awards'), … … 155 190 156 191 h_index = schema.Text( 157 title = _(u'State ofH-Index'),192 title = _(u'State H-Index'), 158 193 description = u'State the full H-index of author, i.e. nominee', 159 194 required = False, … … 161 196 162 197 doc1 = schema.Choice( 198 title = _(u'Curriculum Vitae'), 199 source = CustomerDocumentSource(), 200 description = u'A curriculum vitae including a full list of scholarly ' 201 'publications', 202 required = False, 203 ) 204 205 doc2 = schema.Choice( 163 206 title = _(u'Reference Letters'), 164 207 source = CustomerDocumentSource(), … … 168 211 ) 169 212 170 doc2 = schema.Choice( 171 title = _(u'Photos and Illustrations'), 172 source = CustomerDocumentSource(), 173 description = u'Maximum of 3 photos or illustrations ' 174 'added together in a pdf document', 175 required = False, 176 ) 177 213 doc3 = schema.Choice( 214 title = _(u'Photo or Illustration 1'), 215 source = CustomerDocumentSource(), 216 description = u'(optional)', 217 required = False, 218 ) 219 220 221 doc4 = schema.Choice( 222 title = _(u'Photo or Illustration 2'), 223 source = CustomerDocumentSource(), 224 description = u'(optional)', 225 required = False, 226 ) 227 228 doc5 = schema.Choice( 229 title = _(u'Photo or Illustration 3'), 230 source = CustomerDocumentSource(), 231 description = u'(optional)', 232 required = False, 233 ) 178 234 class IRIAAContract(IUnibenContract): 179 235 """A Retention of Name contract. … … 209 265 """ 210 266 211 title_rank = schema.TextLine(212 title = _(u'Title/Rank'),213 required = True,214 )215 216 department = schema.TextLine(217 title = _(u'Department/Faculty/Institute'),218 required = True,219 )220 221 date_of_birth = FormattedDate(222 title = _(u'Date of Birth'),223 required = True,224 show_year = True,225 )226 227 nationality = schema.Choice(228 vocabulary = nats_vocab,229 title = _(u'Current Nationality'),230 required = True,231 )232 233 address = schema.Text(234 title = _(u'Affiliation/Address'),235 required = True,236 )237 238 app_dates = schema.Text(239 title = _(u'Date of Appointment as Uniben staff'),240 description = u'State periods nominee had a break in service from '241 'UNIBEN service (including leave of absence), '242 'but excluding training/study/sabbatical leave',243 required = True,244 )245 246 bib_cit = schema.Text(247 title = _(u'Biographical Citation'),248 description = u'Suggested biographical citation of '249 'nominee (max. 200 words) in the event that the '250 'nominee is selected for the award.',251 required = True,252 )253 254 sup_stat = schema.Text(255 title = _(u'Supporting Statement'),256 description = u'Supporting statement (max. 200 words) summarizing '257 'the research and innovative achievement of the '258 'candidate. It should preferably focus on one major '259 'achievement/innovation/accomplishment.',260 required = True,261 )262 263 nar_wu = schema.Text(264 title = _(u'Narrative Write-Up'),265 description = u'A narrative write-up (max. 1,000 words) of the '266 'candidate highlighting his/her scientific/creative '267 'achievement and/or innovation; restrict to one major '268 'innovation/achievement/accomplishment. '269 'The national/international impact of the '270 'achievement/innovation should be emphasized.',271 required = True,272 )273 274 item_stat = schema.Text(275 title = _(u'Itemized Statement'),276 description = u'Itemized statement of research leadership and '277 'collaboration (max. 100 words)',278 required = True,279 )280 281 sign_pub = schema.Text(282 title = _(u'Significant Publications'),283 description = u'A list of his/her most significant publications '284 '(max. 10) pertaining to the achievement/innovation '285 'along with each publication\'s H-index',286 required = True,287 )288 289 vitae = schema.Text(290 title = _(u'Curriculum Vitae'),291 description = u'A curriculum vitae including a full list of scholarly '292 'publications',293 required = True,294 )295 296 prev_aw = schema.Text(297 title = _(u'Previous Awards'),298 description = u'List of previous awards, honours and recognition '299 '(max. 10) received by nominee, including awarding '300 'body, purpose of award, date of award, and nature '301 'of award (cash, certificate, plaque, etc)',302 required = True,303 )304 305 lead_rol = schema.Text(306 title = _(u'Leadership Roles'),307 description = u'List of leadership roles in academic/professional '308 'societies/organizations (max. no. of 3)',309 required = True,310 )311 312 h_index = schema.Text(313 title = _(u'State of H-Index'),314 description = u'State the full H-index of author, i.e. nominee',315 required = True,316 )317 318 doc1 = schema.Choice(319 title = _(u'Reference Letters'),320 source = CustomerDocumentSource(),321 description = u'Reference letters from three referees '322 'added together in a pdf document',323 required = True,324 )325 326 doc2 = schema.Choice(327 title = _(u'Photos and Illustrations'),328 source = CustomerDocumentSource(),329 description = u'Maximum of 3 photos or illustrations '330 'added together in a pdf document',331 required = False,332 ) -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py
r14190 r14197 222 222 def setup_customizable_params(self): 223 223 self._contract_category = u'riaa' 224 self._document_factory = 'waeup.UnibenCustomer Document'224 self._document_factory = 'waeup.UnibenCustomerPDFDocument' 225 225 self._contract_factory = 'waeup.RIAAContract' 226 226 return 227 227 228 def test_manage_upload_ sample_file(self):228 def test_manage_upload_pdf_file(self): 229 229 # Managers can upload a file via the DocumentManageFormPage 230 230 # The image is stored even if form has errors … … 232 232 self.browser.open(self.customer_path + '/documents/DOC1/manage') 233 233 # Create a pseudo image file and select it to be uploaded 234 image = open(SAMPLE_ IMAGE, 'rb')235 ctrl = self.browser.getControl(name=' samplescanmanageupload')234 image = open(SAMPLE_PDF, 'rb') 235 ctrl = self.browser.getControl(name='pdfscanmanageupload') 236 236 file_ctrl = ctrl.mech_control 237 file_ctrl.add_file(image, filename='my_sample_scan. jpg')237 file_ctrl.add_file(image, filename='my_sample_scan.pdf') 238 238 # The Save action does not upload files 239 239 self.browser.getControl("Save").click() # submit form 240 240 self.assertFalse( 241 'href="http://localhost/app/customers/B1000000/documents/DOC1/s ample"'241 'href="http://localhost/app/customers/B1000000/documents/DOC1/scan.pdf"' 242 242 in self.browser.contents) 243 243 # ... but the correct upload submit button does 244 image = open(SAMPLE_ IMAGE)245 ctrl = self.browser.getControl(name=' samplescanmanageupload')244 image = open(SAMPLE_PDF) 245 ctrl = self.browser.getControl(name='pdfscanmanageupload') 246 246 file_ctrl = ctrl.mech_control 247 file_ctrl.add_file(image, filename='my_sample_scan. jpg')247 file_ctrl.add_file(image, filename='my_sample_scan.pdf') 248 248 self.browser.getControl( 249 name='upload_ samplescanmanageupload').click()249 name='upload_pdfscanmanageupload').click() 250 250 self.assertTrue( 251 'href="http://localhost/app/customers/B1000000/documents/DOC1/s ample"'251 'href="http://localhost/app/customers/B1000000/documents/DOC1/scan.pdf"' 252 252 in self.browser.contents) 253 # Browsing the link shows a real image254 self.browser.open('s ample')253 # Browsing the link shows a real pdf file 254 self.browser.open('scan.pdf') 255 255 self.assertEqual( 256 self.browser.headers['content-type'], ' image/jpeg')257 self.assertEqual(len(self.browser.contents), 2 787)256 self.browser.headers['content-type'], 'application/pdf') 257 self.assertEqual(len(self.browser.contents), 24241) 258 258 # We can't reupload a file. The existing file must be deleted first. 259 259 self.browser.open(self.customer_path + '/documents/DOC1/manage') 260 260 self.assertFalse( 261 'upload_ samplescanmanageupload' in self.browser.contents)261 'upload_pdfscanmanageupload' in self.browser.contents) 262 262 # File must be deleted first 263 self.browser.getControl(name='delete_ samplescanmanageupload').click()263 self.browser.getControl(name='delete_pdfscanmanageupload').click() 264 264 self.assertTrue( 265 'sample deleted' in self.browser.contents) 266 # Uploading a file which is bigger than 150k will raise an error 267 big_image = StringIO(open(SAMPLE_IMAGE, 'rb').read() * 75) 268 ctrl = self.browser.getControl(name='samplescanmanageupload') 269 file_ctrl = ctrl.mech_control 270 file_ctrl.add_file(big_image, filename='my_sample_scan.jpg') 271 self.browser.getControl( 272 name='upload_samplescanmanageupload').click() 273 self.assertTrue( 274 'Uploaded file is too big' in self.browser.contents) 275 # We do not rely on filename extensions given by uploaders 276 image = open(SAMPLE_IMAGE, 'rb') # a jpg-file 277 ctrl = self.browser.getControl(name='samplescanmanageupload') 278 file_ctrl = ctrl.mech_control 279 # Tell uploaded file is bmp 280 file_ctrl.add_file(image, filename='my_sample_scan.bmp') 281 self.browser.getControl( 282 name='upload_samplescanmanageupload').click() 283 self.assertTrue( 284 # jpg file was recognized 285 'File sample.jpg uploaded.' in self.browser.contents) 286 # Delete file again 287 self.browser.getControl(name='delete_samplescanmanageupload').click() 288 self.assertTrue( 289 'sample deleted' in self.browser.contents) 290 # File names must meet several conditions 291 bmp_image = open(SAMPLE_IMAGE_BMP, 'rb') 292 ctrl = self.browser.getControl(name='samplescanmanageupload') 293 file_ctrl = ctrl.mech_control 294 file_ctrl.add_file(bmp_image, filename='my_sample_scan.bmp') 295 self.browser.getControl( 296 name='upload_samplescanmanageupload').click() 297 self.assertTrue('Only the following extensions are allowed' 298 in self.browser.contents) 265 'scan.pdf deleted' in self.browser.contents) 266 299 267 300 268 class ContractUITests(CustomersFullSetup): … … 305 273 def setup_customizable_params(self): 306 274 self._contract_category = u'riaa' 307 self._document_factory = 'waeup.UnibenCustomer Document'275 self._document_factory = 'waeup.UnibenCustomerPDFDocument' 308 276 self._contract_factory = 'waeup.RIAAContract' 309 277 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_document.py
r14181 r14197 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.documents import UnibenCustomerDocument 32 from ikobacustom.uniben.customers.interfaces import IUnibenCustomerDocument 31 from ikobacustom.uniben.customers.documents import ( 32 UnibenCustomerPDFDocument, UnibenCustomerJPGDocument) 33 from ikobacustom.uniben.customers.interfaces import ( 34 IUnibenCustomerPDFDocument, IUnibenCustomerJPGDocument) 33 35 34 36 … … 38 40 39 41 def test_interfaces(self): 40 verify.verifyClass(IUnibenCustomerDocument, UnibenCustomerDocument) 41 verify.verifyClass(ICustomerNavigation, UnibenCustomerDocument) 42 verify.verifyObject(IUnibenCustomerDocument, UnibenCustomerDocument()) 43 verify.verifyObject(ICustomerNavigation, UnibenCustomerDocument()) 42 verify.verifyClass(IUnibenCustomerPDFDocument, UnibenCustomerPDFDocument) 43 verify.verifyClass(ICustomerNavigation, UnibenCustomerPDFDocument) 44 verify.verifyObject(IUnibenCustomerPDFDocument, UnibenCustomerPDFDocument()) 45 verify.verifyObject(ICustomerNavigation, UnibenCustomerPDFDocument()) 46 verify.verifyClass(IUnibenCustomerJPGDocument, UnibenCustomerJPGDocument) 47 verify.verifyClass(ICustomerNavigation, UnibenCustomerJPGDocument) 48 verify.verifyObject(IUnibenCustomerJPGDocument, UnibenCustomerJPGDocument()) 49 verify.verifyObject(ICustomerNavigation, UnibenCustomerJPGDocument()) 44 50 return 45 51 46 52 def test_addDocument(self): 47 53 container = CustomerDocumentsContainer() 48 document = createObject(u'waeup.UnibenCustomer Document')54 document = createObject(u'waeup.UnibenCustomerPDFDocument') 49 55 id = document.document_id 50 56 container.addDocument(document) 51 57 self.assertEqual(container[id], document) 52 58 self.assertRaises(TypeError, container.addDocument, object()) 53 self.assertEqual(document.class_name, 'UnibenCustomerDocument') 59 self.assertEqual(document.class_name, 'UnibenCustomerPDFDocument') 60 document2 = createObject(u'waeup.UnibenCustomerJPGDocument') 61 id = document2.document_id 62 container.addDocument(document2) 63 self.assertEqual(container[id], document2) 64 self.assertRaises(TypeError, container.addDocument, object()) 65 self.assertEqual(document2.class_name, 'UnibenCustomerJPGDocument') 54 66 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/utils.py
r14184 r14197 45 45 DOCTYPES_DICT = { 46 46 #'UnibenCustomerDocument': _('Uniben Document'), 47 'UnibenCustomerPDFDocument': _('Uniben PDF Document'), 47 'UnibenCustomerPDFDocument': _('PDF Document'), 48 'UnibenCustomerJPGDocument': _('JPG Document'), 48 49 } 49 50 … … 60 61 'unibencustomerpdfdocuments', 61 62 'riaacontracts') 63 64 SEPARATORS_DICT = { 65 'form.nominator_title_rank': _(u'Additional Registrant Data'), 66 'form.nominee_fullname': _(u'Basic Nominee Data'), 67 'form.bib_cit': _(u'Supporting Information'), 68 } -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/utils/utils.py
r14184 r14197 67 67 'customers', 68 68 'unibencustomerpdfdocuments', 69 'unibencustomerjpgdocuments', 69 70 'riaacontracts') 70 71 … … 72 73 'unibencustomerprocessor', 73 74 'unibencustomerpdfdocumentprocessor', 75 'unibencustomerjpgdocumentprocessor', 74 76 'riaacontractprocessor', 75 77 'unibenproductprocessor',
Note: See TracChangeset for help on using the changeset viewer.