Ignore:
Timestamp:
11 Dec 2014, 16:34:01 (10 years ago)
Author:
Henrik Bettermann
Message:

Show documents on contract slip.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12186 r12196  
    156156
    157157
    158 
    159158class CustomersContainerUITests(CustomersFullSetup):
    160159    # Tests for CustomersContainer class views and pages
     
    11101109        open(path, 'wb').write(self.browser.contents)
    11111110        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
    11121125
    11131126
     
    12591272        open(path, 'wb').write(self.browser.contents)
    12601273        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
    12621279        self.browser.open(self.customer_path + '/contracts/c101')
    12631280        self.browser.getLink("Download contract slip").click()
     
    13011318        self.browser.getControl("Save").click()
    13021319        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         return
    1317 
Note: See TracChangeset for help on using the changeset viewer.