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 15508)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 15545)
@@ -3812,5 +3812,5 @@
         self.browser.open(facs_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['bursary']
         self.browser.getControl(name="session").value = ['2004']
@@ -3861,4 +3861,25 @@
             '- discarded: job_id=%s' % job_id in logcontent
             )
+        # Officer can also enter student id and gets the same export file
+        self.browser.open(facs_path)
+        self.browser.getLink("Export student data").click()
+        self.browser.getControl("Enter student ids or matric numbers").click()
+        self.browser.getControl(name="exporter").value = ['bursary']
+        self.browser.getControl(name="students").value = 'K1000000'
+        self.browser.getControl("Create CSV file").click()
+        # When the job is finished and we reload the page...
+        job_id = self.wait_for_export_job_completed()
+        # ... the csv file can be downloaded ...
+        self.browser.open('http://localhost/app/faculties/exports')
+        self.browser.getLink("Download").click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
+            self.browser.headers['content-disposition'])
+        self.assertTrue(
+            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
+            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
+            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
 
     def test_faculty_export(self):
@@ -3867,5 +3888,5 @@
         self.browser.open(fac1_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['students']
         self.browser.getControl(name="session").value = ['2004']
@@ -3877,5 +3898,4 @@
         self.browser.getControl(name="payments_end").value = '14/12/2012'
         self.browser.getControl("Create CSV file").click()
-
         # When the job is finished and we reload the page...
         job_id = self.wait_for_export_job_completed()
@@ -3922,4 +3942,11 @@
             '- discarded: job_id=%s' % job_id in logcontent
             )
+        # Officer can set export parameters but cannot enter student id
+        # at faculty level
+        self.browser.open(fac1_path + '/exports')
+        self.assertTrue("Set export parameters"
+                         in self.browser.contents)
+        self.assertFalse("Enter student ids or matric numbers"
+                         in self.browser.contents)
 
     def test_department_export(self):
@@ -3928,5 +3955,5 @@
         self.browser.open(dep1_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['students']
         self.browser.getControl(name="session").value = ['2004']
@@ -3980,5 +4007,5 @@
         self.browser.open(cert1_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['students']
         self.browser.getControl(name="session").value = ['2004']
@@ -4028,5 +4055,5 @@
         self.browser.open(course1_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['students']
         self.browser.getControl(name="session").value = ['2004']
@@ -4081,10 +4108,10 @@
         self.browser.open(course1_path)
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.assertTrue(
             'Academic session not set. Please contact the administrator.'
             in self.browser.contents)
         self.app['configuration'].current_academic_session = 2004
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.browser.getControl(name="exporter").value = ['lecturer']
         self.browser.getControl(name="session").value = ['2004']
@@ -4148,5 +4175,5 @@
         self.browser.open("http://localhost/app/faculties/fac1/dep1")
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         # Only the sfpaymentsoverview exporter is available for department officers
         self.assertFalse('<option value="students">' in self.browser.contents)
@@ -4166,4 +4193,5 @@
 
     def test_export_bursary_officers(self):
+        self.add_payment(self.student)
         # Create bursary officer
         self.app['users'].addUser('mrbursary', SECRET)
@@ -4180,5 +4208,5 @@
         self.browser.getLink("Academics").click()
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         # Only the bursary exporter is available for bursary officers
         # not only at facultiescontainer level ...
@@ -4193,13 +4221,47 @@
         self.browser.open('http://localhost/app/faculties/fac1/dep1')
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.assertFalse('<option value="students">' in self.browser.contents)
         self.assertTrue('<option value="bursary">' in self.browser.contents)
-        # Thew job can be discarded
+        # Thew job can be downloaded
         self.assertEqual(len(self.app['datacenter'].running_exports), 1)
-        self.wait_for_export_job_completed()
+        job_id = self.wait_for_export_job_completed()
+        self.browser.open('http://localhost/app/faculties/exports')
+        self.browser.getLink("Download").click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
+            self.browser.headers['content-disposition'])
+        self.assertTrue(
+            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
+            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
+            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
+        # ... and discarded
         self.browser.open('http://localhost/app/faculties/exports')
         self.browser.getControl("Discard").click()
         self.assertEqual(len(self.app['datacenter'].running_exports), 0)
+        # At Academics level bursary officers can also enter student ids
+        self.browser.getLink("Academics").click()
+        self.browser.getLink("Export student data").click()
+        self.browser.getControl("Enter student ids or matric numbers").click()
+        self.assertFalse('<option value="students">' in self.browser.contents)
+        self.browser.getControl(name="exporter").value = ['bursary']
+        self.browser.getControl(name="students").value = 'K1000000'
+        self.browser.getControl("Create CSV file").click()
+        # When the job is finished and we reload the page...
+        job_id = self.wait_for_export_job_completed()
+        # ... the csv file can be downloaded ...
+        self.browser.open('http://localhost/app/faculties/exports')
+        self.browser.getLink("Download").click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
+            self.browser.headers['content-disposition'])
+        self.assertTrue(
+            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
+            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
+            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
 
     def test_export_accommodation_officers(self):
@@ -4218,5 +4280,5 @@
         self.browser.getLink("Academics").click()
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         # accommodationpayments and beds exporters are available
         # not only at facultiescontainer level ...
@@ -4234,5 +4296,5 @@
         self.browser.open('http://localhost/app/faculties/fac1/dep1')
         self.browser.getLink("Export student data").click()
-        self.browser.getControl("Configure new export").click()
+        self.browser.getControl("Set export parameters").click()
         self.assertFalse('<option value="students">' in self.browser.contents)
         self.assertTrue('<option value="accommodationpayments">'
