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 12488)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py	(revision 12499)
@@ -34,10 +34,12 @@
     PCNCustomerPDFDocumentExporter,
     PCNCustomerJPGDocumentExporter,
-    RONContractExporter)
+    RONContractExporter,
+    ROPContractExporter)
 from ikobacustom.pcn.customers.batching import (
     PCNCustomerProcessor,
     PCNCustomerPDFDocumentProcessor,
     PCNCustomerJPGDocumentProcessor,
-    RONContractProcessor)
+    RONContractProcessor,
+    ROPContractProcessor)
 from ikobacustom.pcn.testing import FunctionalLayer, samples_dir
 
@@ -68,11 +70,15 @@
         customer['documents'].addDocument(document1)
         customer['documents'].addDocument(document2)
-        contract = createObject(u'waeup.RONContract')
-        contract.tc_dict = {'en':u'Hello World'}
-        customer['contracts'].addContract(contract)
+        contract1 = createObject(u'waeup.RONContract')
+        contract1.tc_dict = {'en':u'Hello World'}
+        customer['contracts'].addContract(contract1)
+        contract2 = createObject(u'waeup.ROPContract')
+        contract2.tc_dict = {'en':u'Hello World'}
+        customer['contracts'].addContract(contract2)
         self.customer = customer
         self.document1 = document1
         self.document2 = document2
-        self.contract = contract
+        self.contract1 = contract1
+        self.contract2 = contract2
         self.outfile = os.path.join(self.workdir, 'myoutput.csv')
         return
@@ -206,5 +212,5 @@
         return
 
-    def test_export_reimport_contracts(self):
+    def test_export_reimport_roncontracts(self):
         # we can export all contracts in a portal
         # set values we can expect in export file
@@ -222,5 +228,5 @@
             '[u\'2015-01-18 16:40:01 WAT - Contract created by system\'],,,,'
             '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,\r\n'
-            % self.contract.contract_id)
+            % self.contract1.contract_id)
         # We can reimport the file if we change the header
         # (user_id -> customer_id). Not all columns are necessary.
@@ -233,5 +239,5 @@
             '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
             ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
-            % self.contract.contract_id)
+            % self.contract1.contract_id)
         result = processor.doImport(
             self.outfile,
@@ -244,5 +250,64 @@
         self.assertEqual(num_fail,1)
         # We remove the original contract.
-        del self.customer['contracts'][self.contract.contract_id]
+        del self.customer['contracts'][self.contract1.contract_id]
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            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,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            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_ropcontracts(self):
+        # we can export all contracts in a portal
+        # set values we can expect in export file
+        self.setup_for_export()
+        exporter = ROPContractExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertMatches(result,
+            'category_practice,class_name,contract_category,contract_id,'
+            'date_of_birth,history,last_product_id,lga,product_object,'
+            'product_options,res_address,state,state_of_origin,superintendent,'
+            'tc_dict,title,user_id,work_address,work_email,work_phone,'
+            'year_qualification\r\n'
+            ',ROPContract,rop,%s,,'
+            '[u\'2015-01-18 16:40:01 WAT - Contract created by system\'],,,,'
+            '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,\r\n'
+            % self.contract2.contract_id)
+        # We can reimport the file if we change the header
+        # (user_id -> customer_id). Not all columns are necessary.
+        processor = ROPContractProcessor()
+        open(self.outfile, 'wb').write(
+            'class_name,contract_category,contract_id,document_object,'
+            'history,last_product_id,product_object,product_options,'
+            'state,tc_dict,title,user_id\r\n'
+            'ROPContract,rop,%s,,'
+            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
+            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
+            % self.contract2.contract_id)
+        result = processor.doImport(
+            self.outfile,
+            ['class_name','contract_category','contract_id','document_object',
+            'history','last_product_id','product_object','product_options',
+            'state','tc_dict','title','customer_id'],
+            mode='create')
+        num, num_fail, finished_path, failed_path = result
+        # The object exists.
+        self.assertEqual(num_fail,1)
+        # We remove the original contract.
+        del self.customer['contracts'][self.contract2.contract_id]
         result = processor.doImport(
             self.outfile,
Index: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
===================================================================
--- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py	(revision 12488)
+++ main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py	(revision 12499)
@@ -29,6 +29,6 @@
 
 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
-from ikobacustom.pcn.customers.contracts import RONContract
-from ikobacustom.pcn.customers.interfaces import IRONContract
+from ikobacustom.pcn.customers.contracts import RONContract, ROPContract
+from ikobacustom.pcn.customers.interfaces import IRONContract, IROPContract
 
 
@@ -42,13 +42,22 @@
         verify.verifyObject(IRONContract, RONContract())
         verify.verifyObject(ICustomerNavigation, RONContract())
+        verify.verifyObject(IROPContract, ROPContract())
+        verify.verifyObject(ICustomerNavigation, ROPContract())
         return
 
     def test_addContract(self):
         container = ContractsContainer()
-        contract = createObject(u'waeup.RONContract')
-        id = contract.contract_id
-        container.addContract(contract)
-        self.assertEqual(container[id], contract)
+        contract1 = createObject(u'waeup.RONContract')
+        id1 = contract1.contract_id
+        container.addContract(contract1)
+        self.assertEqual(container[id1], contract1)
         self.assertRaises(TypeError, container.addContract, object())
-        self.assertEqual(contract.class_name, 'RONContract')
+        self.assertEqual(contract1.class_name, 'RONContract')
+
+        contract2 = createObject(u'waeup.ROPContract')
+        id2 = contract2.contract_id
+        container.addContract(contract2)
+        self.assertEqual(container[id2], contract2)
+        self.assertRaises(TypeError, container.addContract, object())
+        self.assertEqual(contract2.class_name, 'ROPContract')
         return
