Changeset 12036 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 22 Nov 2014, 18:19:07 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/files.py
r12035 r12036 36 36 CustomerBaseDisplayFormPage, CustomerBaseManageFormPage, 37 37 CustomerFilesUploadPage, 38 DocumentDisplayFormPage, DocumentManageFormPage )38 DocumentDisplayFormPage, DocumentManageFormPage, DocumentEditFormPage) 39 39 40 40 grok.context(IIkobaObject) # Make IIkobaObject the default context … … 258 258 259 259 class GenericUploadManage(FileUpload): 260 """Gen ric document upload viewlet for officers.260 """Generic document upload viewlet for officers. 261 261 """ 262 262 grok.order(1) … … 270 270 tab_redirect = '#tab2' 271 271 272 273 class GenericUploadEdit(GenericUploadManage): 274 """Generic document upload viewlet for customer. 275 """ 276 grok.view(DocumentEditFormPage) 277 grok.require('waeup.handleCustomer') 278 279 272 280 class GenericDisplay(FileDisplay): 273 281 """Genreric document display viewlet. … … 281 289 download_name = u'generic' 282 290 291 283 292 class GenericImage(Image): 284 293 """Generic document. -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12034 r12036 864 864 self.browser.getLink("View").click() 865 865 self.assertEqual(self.browser.url, self.documents_path + '/d102/index') 866 # Costumer can upload a document. 867 self.browser.getLink("Edit").click() 868 ctrl = self.browser.getControl(name='genericuploadedit') 869 file_obj = open(SAMPLE_IMAGE, 'rb') 870 file_ctrl = ctrl.mech_control 871 file_ctrl.add_file(file_obj, filename='my_document.jpg') 872 self.browser.getControl( 873 name='upload_genericuploadedit').click() 874 self.assertTrue( 875 'href="http://localhost/app/customers/K1000000/documents/d102/generic"' 876 in self.browser.contents) 866 877 # Costumer can submit the form. The form is also saved. 867 self.browser.getLink("Edit").click()868 878 self.browser.getControl(name="form.title").value = 'My third doc' 869 879 self.browser.getControl("Final Submit").click()
Note: See TracChangeset for help on using the changeset viewer.