Index: main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 17835)
+++ main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 17845)
@@ -20,4 +20,5 @@
 import tempfile
 import pytz
+from time import time
 from datetime import datetime, timedelta, date
 from StringIO import StringIO
@@ -1260,2 +1261,39 @@
         open(path, 'wb').write(self.browser.contents)
         print "Sample PDF tiship_slip.pdf written to %s" % path
+
+    def test_fiancial_clearance_pdf_slip(self):
+        payment1 = createObject(u'waeup.StudentOnlinePayment')
+        timestamp = ("%d" % int(time()*10000))[1:]
+        payment1.p_id = "LSCNEW-2-4153206270" # the longest possible p_id
+        payment1.p_category = 'schoolfee'
+        payment1.p_item = u'My School Fee'
+        payment1.p_session = 2015
+        payment1.p_level = 100
+        payment1.p_current = True
+        payment1.amount_auth = 23456.9
+        payment1.approve()
+        payment2 = createObject(u'waeup.StudentOnlinePayment')
+        timestamp = ("%d" % int(time()*10000))[1:]
+        payment2.p_id = "p%s" % timestamp
+        payment2.p_category = 'clearance'
+        payment2.p_item = u'My Clearance Fee'
+        payment2.p_session = 2015
+        payment2.p_level = 100
+        payment2.p_current = True
+        payment2.amount_auth = 5678.6
+        payment2.approve()
+        self.student['payments'][payment1.p_id] = payment1
+        self.student['payments'][payment2.p_id] = payment2
+        self.student.nysc = True
+        self.student.nysc_updated = datetime.now(pytz.utc)
+        self.student.nysc_senate_info = u'Senate Info test'
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.student_path + '/clear_financially')
+        self.browser.getLink("Download fee payment history").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'],
+                         'application/pdf')
+        path = os.path.join(samples_dir(), 'fee_payment_history.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF fee_payment_history.pdf written to %s" % path
+        return
