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 12482)
+++ 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
