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 12515)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 12518)
@@ -3313,4 +3313,30 @@
             )
 
+    def test_datacenter_export_selected(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open('http://localhost/app/datacenter/@@exportselected')
+        self.browser.getControl(name="exporter").value = ['students']
+        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/datacenter/@@export')
+        self.browser.getLink("Download").click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_students_%s.csv' % job_id in
+            self.browser.headers['content-disposition'])
+        self.assertTrue(
+            'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,'
+            'firstname,lastname,matric_number,middlename,nationality,'
+            'officer_comment,perm_address,personal_updated,phone,reg_number,'
+            'sex,student_id,suspended,suspended_comment,transcript_comment,'
+            'password,state,history,certcode,is_postgrad,current_level,'
+            'current_session\r\n'
+            ',1,,1981-02-04#,aa@aa.ng,,Anna,Tester,234,,,,,,'
+            '1234#,123,m,K1000000,0,,,{SSHA}' in self.browser.contents)
+
     def test_payment_dates(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 12515)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 12518)
@@ -262,4 +262,20 @@
         return
 
+    def test_export_selected(self):
+        # we can export a filtered set of students (filtered by session/level)
+        self.setup_student(self.student)
+        self.app['students'].addStudent(self.student)
+        notify(grok.ObjectModifiedEvent(self.student))
+        exporter = StudentExporter()
+        exporter.export_selected(
+            self.app, self.outfile, selected=['A111111'])
+        result1 = open(self.outfile, 'rb').read()
+        exporter.export_selected(
+            self.app, self.outfile, selected=[])
+        result2 = open(self.outfile, 'rb').read()
+        self.assertTrue(self.std_csv_entry in result1)
+        self.assertFalse(self.std_csv_entry in result2)
+        return
+
     def test_export_filtered_by_dept(self):
         # we can export a set of students filtered by department
@@ -405,4 +421,21 @@
         return
 
+    def test_export_selected(self):
+        # we can export a filtered set of students (filtered by session/level)
+        self.setup_student(self.student)
+        self.app['students'].addStudent(self.student)
+        notify(grok.ObjectModifiedEvent(self.student))
+        exporter = StudentStudyCourseExporter()
+        exporter.export_selected(
+            self.app, self.outfile, selected=['A111111'])
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'certificate,current_level,current_session,current_verdict,'
+            'entry_mode,entry_session,previous_verdict,student_id\r\n'
+
+            'CERT1,200,2012,0,ug_ft,2010,0,A111111\r\n'
+            )
+        return
 
 
@@ -502,4 +535,23 @@
         exporter.export_filtered(
             self.student, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'gpa,level,level_session,level_verdict,total_credits,'
+            'validated_by,validation_date,'
+            'student_id,number_of_tickets,certcode\r\n'
+            '0.0,100,2012,A,100,,,A111111,1,CERT1\r\n'
+            )
+        return
+
+    def test_export_selected(self):
+        # we can export studylevels of a filtered set of students
+        self.setup_student(self.student)
+        self.app['students'].addStudent(self.student)
+        notify(grok.ObjectModifiedEvent(self.student))
+
+        exporter = StudentStudyLevelExporter()
+        exporter.export_selected(
+            self.app, self.outfile, selected=['A111111'])
         result = open(self.outfile, 'rb').read()
         self.assertEqual(
