Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12151)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12161)
@@ -43,5 +43,9 @@
 from waeup.ikoba.customers.customer import Customer
 from waeup.ikoba.interfaces import (
-    IUserAccount, IJobManager, APPROVED, SUBMITTED)
+    IUserAccount, IJobManager, APPROVED, SUBMITTED,
+    IFileStoreNameChooser, IExtFileStore, IFileStoreHandler)
+from waeup.ikoba.imagestorage import (
+    FileStoreNameChooser, ExtFileStore, DefaultFileStoreHandler,
+    DefaultStorage)
 from waeup.ikoba.authentication import LocalRoleSetEvent
 from waeup.ikoba.tests.test_async import FunctionalAsyncTestCase
@@ -1212,6 +1216,5 @@
 
     def test_contract_approval(self):
-        # This is not a UI test. It just tests the approval
-        # of contracts.
+        # This is not a UI test. It just a functional test.
         self.assertRaises(ConstraintNotSatisfied,
             self.contract.document_object, self.document)
@@ -1227,5 +1230,4 @@
         self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
 
-
     def test_contract_approval_in_UI(self):
         # Now let's see what the UI says why trying to approve a contract
@@ -1246,2 +1248,17 @@
         self.browser.getControl("Save").click()
         self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
+
+    def test_get_setmd5_file(self):
+        # A proper file name chooser is registered for customer documents.
+        # This is not a UI test. It just a functional test.
+        file_id = IFileStoreNameChooser(self.document).chooseName(attr='sample')
+        fs = ExtFileStore(root=self.dc_root)
+        fs.createFile(file_id, StringIO('my sample 1'))
+        result = fs.getFileByContext(self.document, attr='sample')
+        self.assertEqual(file_id, '__file-customerdocument__01000/K1000000/sample_d101_K1000000')
+        self.assertEqual(result.read(), 'my sample 1')
+        self.assertEqual(self.document.connected_files[0][1].read(), 'my sample 1')
+        self.document.setMD5()
+        self.assertEqual(self.document.sample_md5, 'a406995ee8eb6772bacf51aa4b0caa24')
+        return
+
