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 9843)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9844)
@@ -2835,5 +2835,5 @@
             )
 
-    def test_course_export(self):
+    def test_course_export_students(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         course1_path = 'http://localhost/app/faculties/fac1/dep1/courses/COURSE1'
@@ -2880,2 +2880,48 @@
             '- discarded: job_id=%s' % job_id in logcontent
             )
+
+    def test_course_export_coursetickets(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        course1_path = 'http://localhost/app/faculties/fac1/dep1/courses/COURSE1'
+        self.browser.open(course1_path)
+        self.browser.getLink("Export student data").click()
+        self.browser.getControl("Configure new export").click()
+        self.browser.getControl(name="exporter").value = ['coursetickets']
+        self.browser.getControl(name="session").value = ['2004']
+        self.browser.getControl(name="level").value = ['100']
+        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()
+        self.browser.open(course1_path + '/exports')
+        # ... the csv file can be downloaded ...
+        self.browser.getLink("Download").click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_coursetickets_%s.csv' % job_id in
+            self.browser.headers['content-disposition'])
+        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
+        job_id = self.app['datacenter'].running_exports[0][0]
+        # ... and discarded
+        self.browser.open(course1_path + '/exports')
+        self.browser.getControl("Discard").click()
+        self.assertEqual(len(self.app['datacenter'].running_exports), 0)
+        # Creation, downloading and discarding is logged
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'datacenter.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            'zope.mgr - students.browser.CourseExportJobContainerJobConfig '
+            '- exported: coursetickets (2004, 100, COURSE1), job_id=%s'
+            % job_id in logcontent
+            )
+        self.assertTrue(
+            'zope.mgr - students.browser.ExportJobContainerDownload '
+            '- downloaded: WAeUP.Kofa_coursetickets_%s.csv, job_id=%s'
+            % (job_id, job_id) in logcontent
+            )
+        self.assertTrue(
+            'zope.mgr - students.browser.ExportJobContainerOverview '
+            '- discarded: job_id=%s' % job_id in logcontent
+            )
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 9843)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 9844)
@@ -554,5 +554,5 @@
 
     def test_export_filtered(self):
-        # we can export studylevels of a filtered set of students
+        # we can export course tickets of a filtered set of students
         self.setup_student(self.student)
         self.app['students'].addStudent(self.student)
@@ -568,4 +568,24 @@
             'passmark,score,semester,title,student_id,certcode\r\n'
             '1,1,CRS1,100,DEP1,FAC1,100,0,100,,2,Course 1,A111111,CERT1\r\n'
+            )
+        # if the coursetickets catalog is used to filter students
+        # and (course) code is not None
+        # only course tickets which belong to this course are exported
+        exporter.export_filtered(
+            self.student, self.outfile, cat='coursetickets', code='CRS1')
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
+            'passmark,score,semester,title,student_id,certcode\r\n'
+            '1,1,CRS1,100,DEP1,FAC1,100,0,100,,2,Course 1,A111111,CERT1\r\n'
+            )
+        exporter.export_filtered(
+            self.student, self.outfile, cat='coursetickets', code='any code')
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
+            'passmark,score,semester,title,student_id,certcode\r\n'
             )
         return
