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 11972)
+++ /main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 11973)
@@ -369,4 +369,51 @@
         return
 
-
-
+    def test_manage_import(self):
+        # Managers can import customer data files
+        datacenter_path = 'http://localhost/app/datacenter'
+        # Prepare a csv file for customers
+        open('customers.csv', 'wb').write(
+"""firstname,lastname,reg_number,date_of_birth,email,phone,sex,password
+Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,m,mypwd1
+Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m,mypwd1
+Brit,Berson,2,1990-01-04,aa@aa.ng,1234,m,mypwd1
+""")
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(datacenter_path)
+        self.browser.getLink('Upload data').click()
+        filecontents = StringIO(open('customers.csv', 'rb').read())
+        filewidget = self.browser.getControl(name='uploadfile:file')
+        filewidget.add_file(filecontents, 'text/plain', 'customers.csv')
+        self.browser.getControl(name='SUBMIT').click()
+        self.browser.getLink('Process data').click()
+        button = lookup_submit_value(
+            'select', 'customers_zope.mgr.csv', self.browser)
+        button.click()
+        importerselect = self.browser.getControl(name='importer')
+        modeselect = self.browser.getControl(name='mode')
+        importerselect.getControl('Customer Processor').selected = True
+        modeselect.getControl(value='create').selected = True
+        self.browser.getControl('Proceed to step 3').click()
+        self.assertTrue('Header fields OK' in self.browser.contents)
+        self.browser.getControl('Perform import').click()
+        self.assertTrue('Processing of 1 rows failed' in self.browser.contents)
+        self.assertTrue('Successfully processed 2 rows' in self.browser.contents)
+        self.assertTrue('Batch processing finished' in self.browser.contents)
+
+        # The customers are properly indexed and we can
+        # thus find a customer in  the department
+        self.browser.open(self.manage_container_path)
+        # We can search for a new customer by name ...
+        self.browser.getControl(name="searchtype").value = ['fullname']
+        self.browser.getControl(name="searchterm").value = 'Claus'
+        self.browser.getControl("Find customer(s)").click()
+        self.assertTrue('Claus Finau' in self.browser.contents)
+        # ... and check if the imported password has been properly set
+        ctrl = self.browser.getControl(name='entries')
+        value = ctrl.options[0]
+        claus = self.app['customers'][value]
+        self.assertTrue(IUserAccount(claus).checkPassword('mypwd1'))
+        return
+
+
+
