Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py	(revision 7924)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py	(revision 7925)
@@ -12,9 +12,11 @@
     ApplicantsContainerExporter, ApplicantsExporter)
 from waeup.kofa.applicants.interfaces import (
-    IApplicantsContainerProvider, AppCatSource)
+    IApplicantsContainerProvider, AppCatSource, ApplicationTypeSource)
 from waeup.kofa.applicants.tests.test_batching import (
     ApplicantImportExportSetup)
 from waeup.kofa.interfaces import ICSVExporter
+from waeup.kofa.schoolgrades import ResultEntry
 from waeup.kofa.testing import KofaUnitTestLayer, FunctionalLayer
+from waeup.kofa.utils.utils import KofaUtils
 
 class ApplicantsContainersExporterTest(unittest.TestCase):
@@ -48,6 +50,4 @@
         container.code = u'dp2012'
         container.title = u'General Studies 2012/13'
-        from waeup.kofa.applicants.interfaces import (
-            ApplicationTypeSource, ApplicantContainerProviderSource,)
         container.prefix = list(ApplicationTypeSource()(container))[0]
         container.year = 2012
@@ -106,22 +106,47 @@
         return
 
+    def setup_applicant(self, applicant):
+        # set predictable values for `applicant`
+        applicant.reg_number = u'123456'
+        applicant.applicant_id = u'dp2011_654321'
+        applicant.firstname = u'Anna'
+        applicant.lastname = u'Tester'
+        applicant.middlename = u'M.'
+        applicant.date_of_birth = datetime.date(1981, 2, 4)
+        applicant.sex = 'f'
+        applicant.email = 'anna@sample.com'
+        applicant.phone = u'+234-123-12345'
+        applicant.course1 = self.certificate
+        applicant.course2 = self.certificate
+        applicant.course_admitted = self.certificate
+        applicant.notice = u'Some notice\nin lines.'
+        applicant.screening_score = 98
+        applicant.screening_venue = u'Exam Room'
+        result_entry = ResultEntry(
+            KofaUtils.EXAM_SUBJECTS_DICT.keys()[0],
+            KofaUtils.EXAM_GRADES[0][0]
+            )
+        applicant.school_grades = [
+            result_entry]
+        return applicant
+
     def test_export(self):
         # we can really export applicants
         # set values we can expect in export file
-        self.applicant.reg_number = u'123456'
-        self.applicant.applicant_id = u'dp2011_654321'
-        intid = self.intids.getId(self.applicant)
-        # reindex modified applicant
-        self.cat.index_doc(intid, self.applicant)
+        applicant = self.setup_applicant(self.applicant)
         exporter = ApplicantsExporter()
-        exporter.export([self.applicant], self.outfile)
+        exporter.export([applicant], self.outfile)
         result = open(self.outfile, 'rb').read()
         self.assertEqual(
             result,
-            'reg_number,school_grades,firstname,phone,middlename,lastname,'
-            'lga,screening_score,notice,applicant_id,sex,course2,email,'
-            'date_of_birth,screening_venue,course_admitted,course1\r\n'
+            'applicant_id,course1,course2,course_admitted,date_of_birth,'
+            'email,firstname,lastname,lga,middlename,notice,phone,'
+            'reg_number,school_grades,screening_score,screening_venue,'
+            'sex\r\n'
 
-            '123456,[],Anna,,,Tester,foreigner,,,dp2011_654321,m,,,,,,\r\n'
+            'dp2011_654321,CERT1,CERT1,CERT1,1981-02-04,anna@sample.com,'
+            'Anna,Tester,foreigner,M.,"Some notice\nin lines.",'
+            '+234-123-12345,123456,'
+            '"[(\'computer_science\', \'A\')]",98,Exam Room,f\r\n'
             )
         return
