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 12059)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12062)
@@ -893,10 +893,10 @@
         # Costumer can upload a document.
         self.browser.getLink("Edit").click()
-        ctrl = self.browser.getControl(name='sampleeditupload')
+        ctrl = self.browser.getControl(name='samplescaneditupload')
         file_obj = open(SAMPLE_IMAGE, 'rb')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(file_obj, filename='my_document.jpg')
         self.browser.getControl(
-            name='upload_sampleeditupload').click()
+            name='upload_samplescaneditupload').click()
         self.assertTrue(
             'href="http://localhost/app/customers/K1000000/documents/d102/sample"'
@@ -919,5 +919,5 @@
         # Create a pseudo image file and select it to be uploaded 
         image = open(SAMPLE_IMAGE, 'rb')
-        ctrl = self.browser.getControl(name='samplemanageupload')
+        ctrl = self.browser.getControl(name='samplescanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(image, filename='my_sample_scan.jpg')
@@ -929,9 +929,9 @@
         # ... but the correct upload submit button does
         image = open(SAMPLE_IMAGE)
-        ctrl = self.browser.getControl(name='samplemanageupload')
+        ctrl = self.browser.getControl(name='samplescanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(image, filename='my_sample_scan.jpg')
         self.browser.getControl(
-            name='upload_samplemanageupload').click()
+            name='upload_samplescanmanageupload').click()
         self.assertTrue(
             'href="http://localhost/app/customers/K1000000/documents/d101/sample"'
@@ -945,40 +945,40 @@
         self.browser.open(self.customer_path + '/documents/d101/manage')
         self.assertFalse(
-            'upload_samplemanageupload' in self.browser.contents)
+            'upload_samplescanmanageupload' in self.browser.contents)
         # File must be deleted first
-        self.browser.getControl(name='delete_samplemanageupload').click()
+        self.browser.getControl(name='delete_samplescanmanageupload').click()
         self.assertTrue(
             'sample deleted' in self.browser.contents)
         # Uploading a file which is bigger than 150k will raise an error
         big_image = StringIO(open(SAMPLE_IMAGE, 'rb').read() * 75)
-        ctrl = self.browser.getControl(name='samplemanageupload')
+        ctrl = self.browser.getControl(name='samplescanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(big_image, filename='my_sample_scan.jpg')
         self.browser.getControl(
-            name='upload_samplemanageupload').click()
+            name='upload_samplescanmanageupload').click()
         self.assertTrue(
             'Uploaded file is too big' in self.browser.contents)
         # we do not rely on filename extensions given by uploaders
         image = open(SAMPLE_IMAGE, 'rb') # a jpg-file
-        ctrl = self.browser.getControl(name='samplemanageupload')
+        ctrl = self.browser.getControl(name='samplescanmanageupload')
         file_ctrl = ctrl.mech_control
         # tell uploaded file is bmp
         file_ctrl.add_file(image, filename='my_sample_scan.bmp')
         self.browser.getControl(
-            name='upload_samplemanageupload').click()
+            name='upload_samplescanmanageupload').click()
         self.assertTrue(
             # jpg file was recognized
             'File sample.jpg uploaded.' in self.browser.contents)
         # Delete file again
-        self.browser.getControl(name='delete_samplemanageupload').click()
+        self.browser.getControl(name='delete_samplescanmanageupload').click()
         self.assertTrue(
             'sample deleted' in self.browser.contents)
         # File names must meet several conditions
         bmp_image = open(SAMPLE_IMAGE_BMP, 'rb')
-        ctrl = self.browser.getControl(name='samplemanageupload')
+        ctrl = self.browser.getControl(name='samplescanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(bmp_image, filename='my_sample_scan.bmp')
         self.browser.getControl(
-            name='upload_samplemanageupload').click()
+            name='upload_samplescanmanageupload').click()
         self.assertTrue('Only the following extensions are allowed'
             in self.browser.contents)
@@ -995,24 +995,24 @@
         # Create a pseudo image file and select it to be uploaded
         image = open(SAMPLE_IMAGE, 'rb')
-        ctrl = self.browser.getControl(name='pdfmanageupload')
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(image, filename='my_sample_scan.jpg')
         self.browser.getControl(
-            name='upload_pdfmanageupload').click()
+            name='upload_pdfscanmanageupload').click()
         self.assertTrue(
             'pdf file extension expected' in self.browser.contents)
-        ctrl = self.browser.getControl(name='pdfmanageupload')
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(image, filename='my_sample_scan.pdf')
         self.browser.getControl(
-            name='upload_pdfmanageupload').click()
+            name='upload_pdfscanmanageupload').click()
         self.assertTrue(
             'Could not determine file type' in self.browser.contents)
         pdf = open(SAMPLE_PDF, 'rb')
-        ctrl = self.browser.getControl(name='pdfmanageupload')
+        ctrl = self.browser.getControl(name='pdfscanmanageupload')
         file_ctrl = ctrl.mech_control
         file_ctrl.add_file(pdf, filename='my_sample_scan.pdf')
         self.browser.getControl(
-            name='upload_pdfmanageupload').click()
+            name='upload_pdfscanmanageupload').click()
         self.assertTrue(
             'href="http://localhost/app/customers/K1000000/documents/d102/sample.pdf">PDF File</a>'
@@ -1025,5 +1025,5 @@
     def test_view_slips(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        # Officers can open the pdf transcript
+        # Officers can open the document overview
         self.browser.open(self.customer_path + '/documents')
         self.browser.getLink("Download documents overview").click()
@@ -1033,2 +1033,10 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample PDF overview_slip.pdf written to %s" % path
+        # Officers can open document slips
+        self.browser.open(self.customer_path + '/documents/d101')
+        self.browser.getLink("Download document slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
+        path = os.path.join(samples_dir(), 'document_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample document_slip.pdf written to %s" % path
