Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12384)
@@ -32,9 +32,11 @@
 from ikobacustom.pcn.customers.export import (
     PCNCustomerExporter,
-    PCNCustomerDocumentExporter,
+    PCNCustomerPDFDocumentExporter,
+    PCNCustomerJPGDocumentExporter,
     PCNContractExporter)
 from ikobacustom.pcn.customers.batching import (
     PCNCustomerProcessor,
-    PCNCustomerDocumentProcessor,
+    PCNCustomerPDFDocumentProcessor,
+    PCNCustomerJPGDocumentProcessor,
     PCNContractProcessor)
 from ikobacustom.pcn.testing import FunctionalLayer, samples_dir
@@ -56,12 +58,16 @@
         IWorkflowState(customer).setState('started')
         self.app['customers'].addCustomer(customer)
-        document = createObject(u'waeup.PCNCustomerDocument')
-        document.title = u'My first document'
-        customer['documents'].addDocument(document)
+        document1 = createObject(u'waeup.PCNCustomerPDFDocument')
+        document1.title = u'My first document'
+        document2 = createObject(u'waeup.PCNCustomerJPGDocument')
+        document2.title = u'My second document'
+        customer['documents'].addDocument(document1)
+        customer['documents'].addDocument(document2)
         contract = createObject(u'waeup.PCNContract')
         contract.tc_dict = {'en':u'Hello World'}
         customer['contracts'].addContract(contract)
         self.customer = customer
-        self.document = document
+        self.document1 = document1
+        self.document2 = document2
         self.contract = contract
         self.outfile = os.path.join(self.workdir, 'myoutput.csv')
@@ -108,23 +114,23 @@
         return
 
-    def test_export_reimport_documents(self):
+    def test_export_reimport_pdf_documents(self):
         # we can export all documents in a portal
         # set values we can expect in export file
         self.setup_for_export()
-        exporter = PCNCustomerDocumentExporter()
+        exporter = PCNCustomerPDFDocumentExporter()
         exporter.export_all(self.app, self.outfile)
         result = open(self.outfile, 'rb').read()
         self.assertMatches(result,
             'class_name,document_id,history,state,title,user_id\r\n'
-            'PCNCustomerDocument,%s,'
+            'PCNCustomerPDFDocument,%s,'
             '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],'
             'created,My first document,K1000000\r\n'
-            % self.document.document_id)
+            % self.document1.document_id)
         # We can reimport the file if we change the header (user_id -> customer_id)
-        processor = PCNCustomerDocumentProcessor()
+        processor = PCNCustomerPDFDocumentProcessor()
         open(self.outfile, 'wb').write(
             'customer_id,class_name,document_id,state,title\r\n'
-            'K1000000,PCNCustomerDocument,%s,started,My first title\r\n'
-            % self.document.document_id)
+            'K1000000,PCNCustomerPDFDocument,%s,started,My first title\r\n'
+            % self.document1.document_id)
         result = processor.doImport(
             self.outfile,
@@ -135,5 +141,49 @@
         self.assertEqual(num_fail,1)
         # We remove the original document.
-        del self.customer['documents'][self.document.document_id]
+        del self.customer['documents'][self.document1.document_id]
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='create')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_fail,0)
+        # We can import the same file in update mode.
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='update')
+        num_succ, num_fail, finished_path, failed_path = result
+        self.assertEqual(num_succ,1)
+        self.assertEqual(num_fail,0)
+        return
+
+    def test_export_reimport_jpg_documents(self):
+        # we can export all documents in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = PCNCustomerJPGDocumentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'class_name,document_id,history,state,title,user_id\r\n'
+            'PCNCustomerJPGDocument,%s,'
+            '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],'
+            'created,My second document,K1000000\r\n'
+            % self.document2.document_id)
+        # We can reimport the file if we change the header (user_id -> customer_id)
+        processor = PCNCustomerJPGDocumentProcessor()
+        open(self.outfile, 'wb').write(
+            'customer_id,class_name,document_id,state,title\r\n'
+            'K1000000,PCNCustomerJPGDocument,%s,started,My second title\r\n'
+            % self.document2.document_id)
+        result = processor.doImport(
+            self.outfile,
+            ['customer_id','class_name','document_id','state','title'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original document.
+        del self.customer['documents'][self.document2.document_id]
         result = processor.doImport(
             self.outfile,
@@ -219,5 +269,5 @@
         self.browser.open(self.customer_path + '/documents')
         self.browser.getControl("Add document").click()
-        self.browser.getControl(name="doctype").value = ['PCNCustomerDocument']
+        self.browser.getControl(name="doctype").value = ['PCNCustomerPDFDocument']
         self.browser.getControl(name="form.title").value = 'My PCN Document'
         self.browser.getControl("Add document").click()
@@ -247,8 +297,8 @@
             name='upload_pdfscanmanageupload').click()
         self.assertTrue(
-            'href="http://localhost/app/customers/K1000000/documents/%s/sample.pdf">PDF File</a>'
+            'href="http://localhost/app/customers/K1000000/documents/%s/scan.pdf">PDF File</a>'
             % docid in self.browser.contents)
         # Browsing the link shows a real pdf
-        self.browser.open('sample.pdf')
+        self.browser.open('scan.pdf')
         self.assertEqual(
             self.browser.headers['content-type'], 'application/pdf')
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py	(revision 12371)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py	(revision 12384)
@@ -29,6 +29,6 @@
 
 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
-from ikobacustom.pcn.customers.documents import PCNCustomerDocument
-from ikobacustom.pcn.customers.interfaces import IPCNCustomerDocument
+from ikobacustom.pcn.customers.documents import PCNCustomerPDFDocument
+from ikobacustom.pcn.customers.interfaces import IPCNCustomerPDFDocument
 
 
@@ -38,17 +38,17 @@
 
     def test_interfaces(self):
-        verify.verifyClass(IPCNCustomerDocument, PCNCustomerDocument)
-        verify.verifyClass(ICustomerNavigation, PCNCustomerDocument)
-        verify.verifyObject(IPCNCustomerDocument, PCNCustomerDocument())
-        verify.verifyObject(ICustomerNavigation, PCNCustomerDocument())
+        verify.verifyClass(IPCNCustomerPDFDocument, PCNCustomerPDFDocument)
+        verify.verifyClass(ICustomerNavigation, PCNCustomerPDFDocument)
+        verify.verifyObject(IPCNCustomerPDFDocument, PCNCustomerPDFDocument())
+        verify.verifyObject(ICustomerNavigation, PCNCustomerPDFDocument())
         return
 
     def test_addDocument(self):
         container = CustomerDocumentsContainer()
-        document = createObject(u'waeup.PCNCustomerDocument')
+        document = createObject(u'waeup.PCNCustomerPDFDocument')
         id = document.document_id
         container.addDocument(document)
         self.assertEqual(container[id], document)
         self.assertRaises(TypeError, container.addDocument, object())
-        self.assertEqual(document.class_name, 'PCNCustomerDocument')
+        self.assertEqual(document.class_name, 'PCNCustomerPDFDocument')
         return
