Index: main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py	(revision 16240)
+++ main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py	(revision 16548)
@@ -32,4 +32,6 @@
 from waeup.kofa.applicants.tests.test_browser import (
     ApplicantsFullSetup, container_name_1, session_1)
+
+SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg')
 
 class CustomApplicantUITest(ApplicantsFullSetup):
@@ -344,18 +346,19 @@
         self.browser.open(self.transapplicant_manage_path)
         # Create a pseudo file with acceptable size
-        pdf_content = 'A' * 1024 * 300  # A string of 300 KB size
-        pseudo_pdf = StringIO(pdf_content)
-        ctrl = self.browser.getControl(name='stateresult.pdf')
+        #pdf_content = 'A' * 1024 * 300  # A string of 300 KB size
+        #pseudo_pdf = StringIO(pdf_content)
+        image = open(SAMPLE_IMAGE, 'rb')
+        ctrl = self.browser.getControl(name='stateresult')
         file_ctrl = ctrl.mech_control
-        file_ctrl.add_file(pseudo_pdf, filename='myform.pdf')
+        file_ctrl.add_file(image, filename='my_scan.jpg')
         self.browser.getControl("Save").click() # submit form
         # Even though the form could not be saved ...
         self.assertTrue('Required input is missing' in self.browser.contents)
         # ... the file has been successfully uploaded
-        pdf_url = self.transapplicant_manage_path.replace('manage', 'stateresult.pdf')
-        self.browser.open(pdf_url)
+        image_url = self.transapplicant_manage_path.replace('manage', 'stateresult')
+        self.browser.open(image_url)
         self.assertEqual(
-            self.browser.headers['content-type'], 'application/pdf')
-        self.assertEqual(len(self.browser.contents), 307200)
+            self.browser.headers['content-type'], 'image/jpeg')
+        self.assertEqual(len(self.browser.contents), 2787)
         # There is really a file stored for the applicant
         storage = getUtility(IExtFileStore)
@@ -365,11 +368,11 @@
         fd = storage.getFile(file_id)
         file_len = len(fd.read())
-        self.assertEqual(file_len, 307200)
+        self.assertEqual(file_len, 2787)
         # A file link is displayed on the edit view ...
         self.browser.open(self.transapplicant_manage_path)
-        self.assertTrue('<a href="stateresult.pdf">' in self.browser.contents)
+        self.assertTrue('<a href="stateresult">' in self.browser.contents)
         # ... and on the dislay view
         self.browser.open(self.transapplicant_view_path)
-        self.assertTrue('stateresult.pdf">Statement of Result</a>'
+        self.assertTrue('stateresult">Statement of Result</a>'
             in self.browser.contents)
         # Adding file is properly logged
@@ -416,18 +419,19 @@
         self.browser.open(self.verapplicant_manage_path)
         # Create a pseudo file with acceptable size
-        pdf_content = 'A' * 1024 * 300  # A string of 300 KB size
-        pseudo_pdf = StringIO(pdf_content)
-        ctrl = self.browser.getControl(name='verificationdoc.pdf')
+        #pdf_content = 'A' * 1024 * 300  # A string of 300 KB size
+        #pseudo_pdf = StringIO(pdf_content)
+        image = open(SAMPLE_IMAGE, 'rb')
+        ctrl = self.browser.getControl(name='verificationdoc')
         file_ctrl = ctrl.mech_control
-        file_ctrl.add_file(pseudo_pdf, filename='myform.pdf')
+        file_ctrl.add_file(image, filename='my_scan.jpg')
         self.browser.getControl("Save").click() # submit form
         # Even though the form could not be saved ...
         self.assertTrue('Required input is missing' in self.browser.contents)
         # ... the file has been successfully uploaded
-        pdf_url = self.verapplicant_manage_path.replace('manage', 'verificationdoc.pdf')
-        self.browser.open(pdf_url)
+        image_url = self.verapplicant_manage_path.replace('manage', 'verificationdoc')
+        self.browser.open(image_url)
         self.assertEqual(
-            self.browser.headers['content-type'], 'application/pdf')
-        self.assertEqual(len(self.browser.contents), 307200)
+            self.browser.headers['content-type'], 'image/jpeg')
+        self.assertEqual(len(self.browser.contents), 2787)
         # There is really a file stored for the applicant
         storage = getUtility(IExtFileStore)
@@ -437,11 +441,11 @@
         fd = storage.getFile(file_id)
         file_len = len(fd.read())
-        self.assertEqual(file_len, 307200)
+        self.assertEqual(file_len, 2787)
         # A file link is displayed on the edit view ...
         self.browser.open(self.verapplicant_manage_path)
-        self.assertTrue('<a href="verificationdoc.pdf">' in self.browser.contents)
+        self.assertTrue('<a href="verificationdoc">' in self.browser.contents)
         # ... and on the dislay view
         self.browser.open(self.verapplicant_view_path)
-        self.assertTrue('verificationdoc.pdf">Result/Certificate Document</a>'
+        self.assertTrue('verificationdoc">Result/Certificate Document</a>'
             in self.browser.contents)
         # Adding file is properly logged
@@ -454,5 +458,5 @@
             % (self.verapplicant.applicant_id)
             in logcontent)
-        # When an applicant is removed, also the pdf files are gone.
+        # When an applicant is removed, also the files are gone.
         del self.app['applicants'][self.vercontainer.code][self.verapplicant.application_number]
         fd = storage.getFile(file_id)
