Changeset 12162 for main/waeup.ikoba
- Timestamp:
- 7 Dec 2014, 15:13:26 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12161 r12162 126 126 """Set md5 checksum attribute for all files connected to this document. 127 127 """ 128 for file in self.connected_files: 129 attrname = '%s_md5' % file[0] 130 checksum = md5(file[1].read()).hexdigest() 131 setattr(self, attrname, checksum) 128 connected_files = self.connected_files 129 if connected_files: 130 for file in self.connected_files: 131 attrname = '%s_md5' % file[0] 132 checksum = md5(file[1].read()).hexdigest() 133 setattr(self, attrname, checksum) 132 134 return 133 135 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12161 r12162 975 975 self.assertTrue( 976 976 'Uploaded file is too big' in self.browser.contents) 977 # we do not rely on filename extensions given by uploaders977 # We do not rely on filename extensions given by uploaders 978 978 image = open(SAMPLE_IMAGE, 'rb') # a jpg-file 979 979 ctrl = self.browser.getControl(name='samplescanmanageupload') 980 980 file_ctrl = ctrl.mech_control 981 # tell uploaded file is bmp981 # Tell uploaded file is bmp 982 982 file_ctrl.add_file(image, filename='my_sample_scan.bmp') 983 983 self.browser.getControl( … … 999 999 self.assertTrue('Only the following extensions are allowed' 1000 1000 in self.browser.contents) 1001 1002 def test_verify_document(self): 1003 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1004 self.browser.open(self.customer_path + '/documents/d101/manage') 1005 image = open(SAMPLE_IMAGE, 'rb') 1006 ctrl = self.browser.getControl(name='samplescanmanageupload') 1007 file_ctrl = ctrl.mech_control 1008 file_ctrl.add_file(image, filename='my_sample_scan.jpg') 1009 self.browser.getControl( 1010 name='upload_samplescanmanageupload').click() 1011 IWorkflowState(self.document).setState(SUBMITTED) 1012 # Only after verifying the document, sample_md5 is set 1013 self.assertEqual( 1014 getattr(self.document, 'sample_md5', None), None) 1015 self.browser.open(self.documents_path + '/d101/trigtrans') 1016 self.browser.getControl(name="transition").value = ['verify'] 1017 self.browser.getControl("Save").click() 1018 self.assertEqual( 1019 getattr(self.document, 'sample_md5', None), 1020 '1d1ab893e87c240afb2104d61ddfe180') 1001 1021 1002 1022 def test_manage_upload_pdf_file(self): -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py
r12089 r12162 129 129 last_transition_date when transition happened. 130 130 """ 131 if event.transition.transition_id == 'verify': 132 obj.setMD5() 131 133 msg = event.transition.user_data['msg'] 132 134 history = IObjectHistory(obj)
Note: See TracChangeset for help on using the changeset viewer.