Changeset 12161 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Timestamp:
- 7 Dec 2014, 10:07:29 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12151 r12161 43 43 from waeup.ikoba.customers.customer import Customer 44 44 from waeup.ikoba.interfaces import ( 45 IUserAccount, IJobManager, APPROVED, SUBMITTED) 45 IUserAccount, IJobManager, APPROVED, SUBMITTED, 46 IFileStoreNameChooser, IExtFileStore, IFileStoreHandler) 47 from waeup.ikoba.imagestorage import ( 48 FileStoreNameChooser, ExtFileStore, DefaultFileStoreHandler, 49 DefaultStorage) 46 50 from waeup.ikoba.authentication import LocalRoleSetEvent 47 51 from waeup.ikoba.tests.test_async import FunctionalAsyncTestCase … … 1212 1216 1213 1217 def test_contract_approval(self): 1214 # This is not a UI test. It just tests the approval 1215 # of contracts. 1218 # This is not a UI test. It just a functional test. 1216 1219 self.assertRaises(ConstraintNotSatisfied, 1217 1220 self.contract.document_object, self.document) … … 1227 1230 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1228 1231 1229 1230 1232 def test_contract_approval_in_UI(self): 1231 1233 # Now let's see what the UI says why trying to approve a contract … … 1246 1248 self.browser.getControl("Save").click() 1247 1249 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1250 1251 def test_get_setmd5_file(self): 1252 # A proper file name chooser is registered for customer documents. 1253 # This is not a UI test. It just a functional test. 1254 file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample') 1255 fs = ExtFileStore(root=self.dc_root) 1256 fs.createFile(file_id, StringIO('my sample 1')) 1257 result = fs.getFileByContext(self.document, attr='sample') 1258 self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000') 1259 self.assertEqual(result.read(), 'my sample 1') 1260 self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1') 1261 self.document.setMD5() 1262 self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24') 1263 return 1264
Note: See TracChangeset for help on using the changeset viewer.