Index: main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_browser.py
===================================================================
--- main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_browser.py	(revision 13289)
+++ main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_browser.py	(revision 14557)
@@ -24,7 +24,7 @@
 from zope.catalog.interfaces import ICatalog
 from zope.intid.interfaces import IIntIds
+from hurry.workflow.interfaces import IWorkflowState
 from kofacustom.sampleuni.testing import FunctionalLayer
-from waeup.kofa.schoolgrades import ResultEntry
-from waeup.kofa.utils.utils import KofaUtils
+from waeup.kofa.browser.tests.test_pdf import samples_dir
 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
 from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup
@@ -55,4 +55,5 @@
         applicant.lastname = u'Tester'
         applicant.middlename = u'M.'
+        applicant.nationality = u'NG'
         applicant.date_of_birth = datetime.date(1981, 2, 4)
         applicant.sex = 'f'
@@ -63,52 +64,29 @@
         applicant.course_admitted = self.certificate
         applicant.notice = u'Some notice\nin lines.'
+        applicant.screening_score = 98
+        applicant.screening_venue = u'Exam Room'
+        applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM'
         applicant.password = 'any password'
-        result_entry = ResultEntry(
-            KofaUtils.EXAM_SUBJECTS_DICT.keys()[0],
-            KofaUtils.EXAM_GRADES[0][0]
-            )
-        applicant.school_grades = [
-            result_entry]
         return applicant
 
-    def test_export_reimport_all(self):
-        # we can export all applicants in a portal
-        # set values we can expect in export file
-        self.applicant = self.setup_applicant(self.applicant)
-        exporter = CustomApplicantExporter()
-        exporter.export_all(self.app, self.outfile)
-        result = open(self.outfile, 'rb').read()
-        self.assertTrue(
-            'applicant_id,application_date,application_number,course1,course2,'
-            'course_admitted,date_of_birth,display_fullname,email,firstname,'
-            'history,lastname,locked,middlename,notice,password,phone,'
-            'reg_number,sex,special_application,state,'
-            'student_id,suspended,container_code\r\n'
-            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,'
-            'Anna M. Tester,anna@sample.com,Anna,'
-            in result)
-        self.assertTrue(
-            'Application initialized by system\'],'
-            'Tester,0,M.,"Some notice\nin lines.",any password,'
-            '+234-123-12345#,123456,f,,initialized,,0,dp2011\r\n'
-            in result)
-        # We can import the same file if we ignore some columns.
-        # Since the applicants_catalog hasn't been notified, the same
-        # record with same reg_number can be imported twice.
-        processor = CustomApplicantProcessor()
-        result = processor.doImport(
-            self.outfile,
-            ['ignore_applicant_id','application_date',
-            'ignore_application_number','course1','course2',
-            'course_admitted','date_of_birth',
-            'ignore_display_fullname','email','firstname',
-            'ignore_history','lastname','locked','middlename',
-            'notice','password','phone',
-            'reg_number','sex','special_application','state',
-            'student_id','suspended','container_code'],
-            mode='create')
-        num_succ, num_fail, finished_path, failed_path = result
-        #content = open(failed_path).read()
-        self.assertEqual(num_succ,1)
-        self.assertEqual(num_fail,0)
-        return
+class ApplicantsContainerUITests(ApplicantsFullSetup):
+    # Tests for ApplicantsContainer class views and pages
+
+    layer = FunctionalLayer
+
+    def test_application_slip(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.slip_path = self.view_path + '/application_slip.pdf'
+        self.browser.open(self.manage_path)
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.fill_correct_values()
+        self.browser.getControl("Save").click()
+        IWorkflowState(self.applicant).setState('submitted')
+        self.browser.open(self.manage_path)
+        self.browser.getLink("Download application slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'],
+                         'application/pdf')
+        path = os.path.join(samples_dir(), 'application_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample application_slip.pdf written to %s" % path
Index: main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_export.py
===================================================================
--- main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_export.py	(revision 13289)
+++ main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_export.py	(revision 14557)
@@ -4,5 +4,6 @@
 from waeup.kofa.interfaces import ICSVExporter
 from waeup.kofa.schoolgrades import ResultEntry
-from waeup.kofa.students.tests.test_batching import StudentImportExportSetup
+from waeup.kofa.students.tests.test_batching import (
+    StudentImportExportSetup, curr_year)
 from kofacustom.sampleuni.utils.utils import CustomKofaUtils
 from kofacustom.sampleuni.students.export import (
@@ -46,11 +47,11 @@
         result = open(self.outfile, 'rb').read()
         self.assertMatches(
-            'adm_code,clearance_locked,clr_code,date_of_birth,email,'
-            'employer,firstname,lastname,matric_number,middlename,'
+            'adm_code,clr_code,date_of_birth,email,'
+            'employer,firstname,flash_notice,lastname,matric_number,middlename,'
             'nationality,officer_comment,perm_address,personal_updated,'
             'phone,reg_number,sex,student_id,suspended,suspended_comment,'
             'password,state,history,certcode,is_postgrad,current_level,'
-            'current_session\r\nmy adm code,0,my clr code,1981-02-04#,'
-            'anna@sample.com,,Anna,Tester,234,M.,NG,,'
+            'current_session\r\nmy adm code,my clr code,1981-02-04#,'
+            'anna@sample.com,,Anna,,Tester,234,M.,NG,,'
             '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,'
             'f,A111111,0,,,created,'
@@ -90,8 +91,8 @@
             'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,'
             'r_code,r_desc,student_id,state,current_session\r\n666,'
-            '12.12,2012-04-01 13:12:01#,schoolfee,1,my-id,p-item,'
-            '100,2012,paid,2012-04-01 14:12:01#,12.12,r-code,,'
-            'A111111,created,2012\r\n',
-            result
+            '12.12,%s-04-01 13:12:01#,schoolfee,1,my-id,p-item,'
+            '100,%s,paid,%s-04-01 14:12:01#,12.12,r-code,,'
+            'A111111,created,2012\r\n'
+            % (curr_year-6, curr_year-6, curr_year-6), result
             )
         return
