Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data.csv
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data.csv	(revision 8290)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data.csv	(revision 8291)
@@ -1,4 +1,4 @@
-application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename
-1234,dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1,m,Peter
-2345,dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1,m,Claus
-,dp2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1,m,Alfons
+application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename,password
+1234,dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1,m,Peter,mypwd1
+2345,dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1,m,Claus,
+,dp2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1,m,Alfons,
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_faulty_applicant_data.csv
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_faulty_applicant_data.csv	(revision 8290)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_faulty_applicant_data.csv	(revision 8291)
@@ -1,2 +1,2 @@
-application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename
-,dp2011,1001,Aaren,Pieri,01/02/1990,xx@yy.zz,CERT1,m,Claus
+application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename,password
+,dp2011,1001,Aaren,Pieri,01/02/1990,xx@yy.zz,CERT1,m,Claus,
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 8290)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 8291)
@@ -36,5 +36,5 @@
 from waeup.kofa.university.department import Department
 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
-from waeup.kofa.interfaces import IBatchProcessor
+from waeup.kofa.interfaces import IBatchProcessor, IUserAccount
 
 
@@ -316,13 +316,13 @@
         # Confirm that middlename has not been deleted.
         container = self.app['applicants']['dp2011']
-        for key in container.keys():
-            if container[key].lastname == 'Pieri':
-                applicant = container[key]
-                break
-        self.assertEqual(applicant.middlename, 'Peter')
+        self.assertEqual(container['1234'].middlename, 'Peter')
         # state of Pieri has not changed
         self.assertEqual(container['1234'].state,'initialized')
         # state of Finau has changed
         self.assertEqual(container['2345'].state,'admitted')
+        # password of Pieri has been set
+        self.assertTrue(IUserAccount(container['1234']).checkPassword('mypwd1'))
+        # password of Finau is still unset
+        self.assertEqual(IUserAccount(container['2345']).password,'')
         shutil.rmtree(os.path.dirname(fin_file))
         # Now we import another file which clears all middlename attributes.
@@ -330,5 +330,5 @@
             self.csv_file_update2, APPLICANT_HEADER_FIELDS_UPDATE, 'update')
         self.assertEqual(num_warns,0)
-        assert applicant.middlename is None
+        assert container['1234'].middlename is None
         shutil.rmtree(os.path.dirname(fin_file))
 
