Changeset 12196 for main/waeup.ikoba/trunk
- Timestamp:
- 11 Dec 2014, 16:34:01 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12184 r12196 1346 1346 """Deliver pdf file including metadata. 1347 1347 """ 1348 grok.context(I Contract)1348 grok.context(ISampleContract) 1349 1349 grok.name('contract_slip.pdf') 1350 1350 grok.require('waeup.viewCustomer') … … 1354 1354 'suspended_comment',) 1355 1355 1356 #form_fields = grok.AutoFields(ICustomerPDFContract).omit( 1357 # 'last_transition_date') 1358 form_fields =() 1356 form_fields = grok.AutoFields(ISampleContract).omit( 1357 'last_transition_date') 1359 1358 1360 1359 @property -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py
r12168 r12196 78 78 self.contract_id = generate_contract_id() 79 79 except AttributeError: 80 self.contract_id = u' a123'80 self.contract_id = u'c999' 81 81 self.last_product_id = None 82 82 return -
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 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_contract.py
r12097 r12196 62 62 self.assertRaises(TypeError, container.addContract, object()) 63 63 self.assertEqual(contract.class_name, 'SampleContract') 64 self.assertEqual(id, ' a123')64 self.assertEqual(id, 'c999') 65 65 return 66 66
Note: See TracChangeset for help on using the changeset viewer.