Index: /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py
===================================================================
--- /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py	(revision 12057)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py	(revision 12058)
@@ -313,5 +313,5 @@
     title = _(u'PDF File')
     mus = 1024 * 200
-    download_name = u'pdffile'
+    download_name = u'sample.pdf'
     tab_redirect = '#tab2'
 
@@ -333,5 +333,5 @@
     label = _(u'PDF Scan')
     title = _(u'PDF Scan')
-    download_name = u'pdf'
+    download_name = u'sample.pdf'
 
 
@@ -339,6 +339,6 @@
     """Scan document.
     """
-    grok.name('pdf')
+    grok.name('sample.pdf')
     grok.context(CustomerPDFDocument)
     grok.require('waeup.viewCustomer')
-    download_name = u'pdf'
+    download_name = u'sample.pdf'
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 12057)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12058)
@@ -50,4 +50,5 @@
 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
 SAMPLE_IMAGE_BMP = os.path.join(os.path.dirname(__file__), 'test_image.bmp')
+SAMPLE_PDF = os.path.join(os.path.dirname(__file__), 'test_pdf.pdf')
 
 def lookup_submit_value(name, value, browser):
@@ -861,5 +862,5 @@
             % document.document_id in logcontent)
 
-    def test_edit_document(self):
+    def test_edit_sample_document(self):
         # Customers can manage documents under certain conditions
         self.browser.open(self.login_path)
@@ -911,5 +912,5 @@
         self.assertTrue('The requested form is locked' in self.browser.contents)
 
-    def test_manage_upload_file(self):
+    def test_manage_upload_sample_file(self):
         # Managers can upload a file via the DocumentManageFormPage
         # The image is stored even if form has errors
@@ -983,4 +984,42 @@
             in self.browser.contents)
 
+    def test_manage_upload_pdf_file(self):
+        # Managers can upload a file via the DocumentManageFormPage
+        # The image is stored even if form has errors
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.customer_path + '/documents')
+        self.browser.getLink("Add document").click()
+        self.browser.getControl(name="doctype").value = ['CustomerPDFDocument']
+        self.browser.getControl("Create document").click()
+        self.browser.open(self.documents_path + '/d102/manage')
+        # Create a pseudo image file and select it to be uploaded
+        image = open(SAMPLE_IMAGE, 'rb')
+        ctrl = self.browser.getControl(name='pdfmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(image, filename='my_sample_scan.jpg')
+        self.browser.getControl(
+            name='upload_pdfmanageupload').click()
+        self.assertTrue(
+            'pdf file extension expected' in self.browser.contents)
+        ctrl = self.browser.getControl(name='pdfmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(image, filename='my_sample_scan.pdf')
+        self.browser.getControl(
+            name='upload_pdfmanageupload').click()
+        self.assertTrue(
+            'Could not determine file type' in self.browser.contents)
+        pdf = open(SAMPLE_PDF, 'rb')
+        ctrl = self.browser.getControl(name='pdfmanageupload')
+        file_ctrl = ctrl.mech_control
+        file_ctrl.add_file(pdf, filename='my_sample_scan.pdf')
+        self.browser.getControl(
+            name='upload_pdfmanageupload').click()
+        self.assertTrue(
+            'href="http://localhost/app/customers/K1000000/documents/d102/sample.pdf">PDF File</a>'
+            in self.browser.contents)
+        # Browsing the link shows a real pdf
+        self.browser.open('sample.pdf')
+        self.assertEqual(
+            self.browser.headers['content-type'], 'application/pdf')
 
     def test_view_slips(self):
