Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv	(revision 9412)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv	(revision 9420)
@@ -1,6 +1,9 @@
-reg_number,matric_number,level,code,score,mandatory
-1,,100,COURSE1,1,True
-2,,100,COURSE1,2,False
-,100002,100,COURSE1,3,False
-1,,nonsense,COURSE1,5,
-1,,100,NONSENSE,5,
+reg_number,matric_number,level,code,score,mandatory,level_session
+1,,100,COURSE1,1,True,
+2,,100,COURSE1,2,False,
+,100002,100,COURSE1,3,False,
+1,,nonsense,COURSE1,5,,
+1,,100,NONSENSE,5,,
+1,,200,COURSE1,6,,2004
+1,,300,COURSE1,6,,2008
+1,,300,COURSE1,6,,200888
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9412)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9420)
@@ -733,9 +733,15 @@
 
     def test_import(self):
-
         num, num_warns, fin_file, fail_file = self.processor.doImport(
             self.csv_file, COURSETICKET_HEADER_FIELDS,'create')
-
-        self.assertEqual(num_warns,2)
+        fail_file = open(fail_file).read()
+        self.assertEqual(num_warns,5)
+        self.assertEqual(fail_file,
+            'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
+            '1,COURSE1,,nonsense,,5,,Not all parents do exist yet. Skipping\r\n'
+            '1,NONSENSE,,100,,5,,code: non-existent\r\n'
+            '1,COURSE1,,200,2004,6,,level_session: does not match 2008\r\n'
+            '1,COURSE1,,300,2008,6,,level: does not exist\r\n'
+            '1,COURSE1,,300,200888,6,,level_session: Invalid value; level: does not exist\r\n')
         assert self.processor.entryExists(
             dict(reg_number='1', level='100', code='COURSE1'),
@@ -772,5 +778,13 @@
         num, num_warns, fin_file, fail_file = self.processor.doImport(
             self.csv_file, COURSETICKET_HEADER_FIELDS,'update')
-        self.assertEqual(num_warns,2)
+        fail_file = open(fail_file).read()
+        self.assertEqual(num_warns,5)
+        self.assertEqual(fail_file,
+            'reg_number,code,mandatory,level,level_session,score,matric_number,--ERRORS--\r\n'
+            '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n'
+            '1,NONSENSE,<IGNORE>,100,<IGNORE>,5,<IGNORE>,code: non-existent\r\n'
+            '1,COURSE1,<IGNORE>,200,2004,6,<IGNORE>,level_session: does not match 2008\r\n'
+            '1,COURSE1,<IGNORE>,300,2008,6,<IGNORE>,level: does not exist\r\n'
+            '1,COURSE1,<IGNORE>,300,200888,6,<IGNORE>,level_session: Invalid value; level: does not exist\r\n')
         shutil.rmtree(os.path.dirname(fin_file))
 
@@ -786,5 +800,5 @@
         num, num_warns, fin_file, fail_file = self.processor.doImport(
             self.csv_file, COURSETICKET_HEADER_FIELDS,'remove')
-        self.assertEqual(num_warns,2)
+        self.assertEqual(num_warns,5)
         assert self.processor.entryExists(
             dict(reg_number='1', level='100', code='COURSE1'), self.app) is False
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9412)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9420)
@@ -161,6 +161,6 @@
         self.certificate.school_fee_1 = 40000.0
         self.certificate.school_fee_2 = 20000.0
-        self.app['faculties']['fac1'] = Faculty(code='fac1')
-        self.app['faculties']['fac1']['dep1'] = Department(code='dep1')
+        self.app['faculties']['fac1'] = Faculty(code=u'fac1')
+        self.app['faculties']['fac1']['dep1'] = Department(code=u'dep1')
         self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
             self.certificate)
