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 14992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 15042)
@@ -42,4 +42,5 @@
 from waeup.kofa.app import University
 from waeup.kofa.payments.interfaces import IPayer
+from waeup.kofa.students.payments import StudentOnlinePayment
 from waeup.kofa.students.student import Student
 from waeup.kofa.students.studylevel import StudentStudyLevel
@@ -58,4 +59,5 @@
 URL_LECTURER_LANDING = 'http://localhost/app/my_courses'
 
+curr_year = datetime.now().year
 
 def lookup_submit_value(name, value, browser):
@@ -3484,4 +3486,23 @@
         return job_id
 
+    def add_payment(self, student):
+        # get a payment with all fields set
+        payment = StudentOnlinePayment()
+        payment.creation_date = datetime(2012, 12, 13)
+        payment.p_id = 'my-id'
+        payment.p_category = u'schoolfee'
+        payment.p_state = 'paid'
+        payment.ac = u'666'
+        payment.p_item = u'p-item'
+        payment.p_level = 100
+        payment.p_session = curr_year - 6
+        payment.payment_date = datetime(2012, 12, 13)
+        payment.amount_auth = 12.12
+        payment.r_amount_approved = 12.12
+        payment.r_code = u'r-code'
+        # XXX: there is no addPayment method to give predictable names
+        self.payment = student['payments']['my-payment'] = payment
+        return payment
+
     def test_datacenter_export(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -3518,5 +3539,5 @@
             'zope.mgr - students.browser.DatacenterExportJobContainerJobConfig '
             '- exported: bursary (2004, 100, ug_ft, None, None, None, '
-            '13/12/2012, 14/12/2012), job_id=%s'
+            '13/12/2012, 14/12/2012, all, all, all), job_id=%s'
             % job_id in logcontent
             )
@@ -3572,4 +3593,5 @@
 
     def test_faculties_export(self):
+        self.add_payment(self.student)
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         facs_path = 'http://localhost/app/faculties'
@@ -3583,4 +3605,5 @@
         self.browser.getControl(name="payments_start").value = '13/12/2012'
         self.browser.getControl(name="payments_end").value = '14/12/2012'
+        self.browser.getControl(name="paycat").value = ['schoolfee']
         self.browser.getControl("Create CSV file").click()
 
@@ -3595,4 +3618,8 @@
             '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,2012,'
+            '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)
         self.assertEqual(len(self.app['datacenter'].running_exports), 1)
         job_id = self.app['datacenter'].running_exports[0][0]
@@ -3608,5 +3635,5 @@
             'zope.mgr - students.browser.FacultiesExportJobContainerJobConfig '
             '- exported: bursary (2004, 100, ug_ft, None, None, None, '
-            '13/12/2012, 14/12/2012), job_id=%s'
+            '13/12/2012, 14/12/2012, all, all, schoolfee), job_id=%s'
             % job_id in logcontent
             )
@@ -3669,5 +3696,5 @@
             'zope.mgr - students.browser.FacultyExportJobContainerJobConfig '
             '- exported: students (2004, 100, ug_ft, fac1, None, None, '
-            '13/12/2012, 14/12/2012), job_id=%s'
+            '13/12/2012, 14/12/2012, all, all, all), job_id=%s'
             % job_id in logcontent
             )
@@ -3721,5 +3748,5 @@
             'zope.mgr - students.browser.DepartmentExportJobContainerJobConfig '
             '- exported: students (2004, 100, ug_ft, None, dep1, None, '
-            '13/12/2012, 14/12/2012), job_id=%s'
+            '13/12/2012, 14/12/2012, all, all, all), job_id=%s'
             % job_id in logcontent
             )
@@ -3767,5 +3794,6 @@
         self.assertTrue(
             'zope.mgr - students.browser.CertificateExportJobContainerJobConfig '
-            '- exported: students (2004, 100, None, None, None, CERT1, None, None), '
+            '- exported: students '
+            '(2004, 100, None, None, None, CERT1, , , None, None, None), '
             'job_id=%s'
             % job_id in logcontent
