- Timestamp:
- 11 Dec 2014, 16:34:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12186 r12196 156 156 157 157 158 159 158 class CustomersContainerUITests(CustomersFullSetup): 160 159 # Tests for CustomersContainer class views and pages … … 1110 1109 open(path, 'wb').write(self.browser.contents) 1111 1110 print "Sample pdfdocument_slip.pdf written to %s" % path 1111 1112 def test_get_setmd5_file(self): 1113 # A proper file name chooser is registered for customer documents. 1114 # This is not a UI test. It's just a functional test. 1115 file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample') 1116 fs = ExtFileStore(root=self.dc_root) 1117 fs.createFile(file_id, StringIO('my sample 1')) 1118 result = fs.getFileByContext(self.document, attr='sample') 1119 self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000') 1120 self.assertEqual(result.read(), 'my sample 1') 1121 self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1') 1122 self.document.setMD5() 1123 self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24') 1124 return 1112 1125 1113 1126 … … 1259 1272 open(path, 'wb').write(self.browser.contents) 1260 1273 print "Sample PDF overview_slip.pdf written to %s" % path 1261 # Officers can open contract slips 1274 # Officers can open contract slips. 1275 # First we add a submitted document and a product. 1276 IWorkflowState(self.document).setState(SUBMITTED) 1277 self.contract.document_object = self.document 1278 self.contract.product_object = self.product 1262 1279 self.browser.open(self.customer_path + '/contracts/c101') 1263 1280 self.browser.getLink("Download contract slip").click() … … 1301 1318 self.browser.getControl("Save").click() 1302 1319 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1303 1304 def test_get_setmd5_file(self):1305 # A proper file name chooser is registered for customer documents.1306 # This is not a UI test. It just a functional test.1307 file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample')1308 fs = ExtFileStore(root=self.dc_root)1309 fs.createFile(file_id, StringIO('my sample 1'))1310 result = fs.getFileByContext(self.document, attr='sample')1311 self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000')1312 self.assertEqual(result.read(), 'my sample 1')1313 self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1')1314 self.document.setMD5()1315 self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24')1316 return1317
Note: See TracChangeset for help on using the changeset viewer.