Changeset 13621 for main/waeup.uniben/trunk/src/waeup/uniben/students/tests
- Timestamp:
- 16 Jan 2016, 16:24:39 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r13583 r13621 20 20 import tempfile 21 21 import pytz 22 from time import time23 22 from datetime import datetime, timedelta, date 24 23 from StringIO import StringIO … … 1044 1043 self.assertEqual(self.student['payments'][value].amount_auth, 987.0) 1045 1044 return 1046 1047 def test_bursary_pdf_slip(self):1048 payment1 = createObject(u'waeup.StudentOnlinePayment')1049 timestamp = ("%d" % int(time()*10000))[1:]1050 payment1.p_id = "p%s" % timestamp1051 payment1.p_category = 'schoolfee'1052 payment1.p_item = u'My School Fee'1053 payment1.p_session = 20151054 payment1.p_level = 1001055 payment1.p_current = True1056 payment1.amount_auth = 23456.91057 payment1.approve()1058 payment2 = createObject(u'waeup.StudentOnlinePayment')1059 timestamp = ("%d" % int(time()*10000))[1:]1060 payment2.p_id = "p%s" % timestamp1061 payment2.p_category = 'clearance'1062 payment2.p_item = u'My Clearance Fee'1063 payment2.p_session = 20151064 payment2.p_level = 1001065 payment2.p_current = True1066 payment2.amount_auth = 5678.61067 payment2.approve()1068 self.student['payments'][payment1.p_id] = payment11069 self.student['payments'][payment2.p_id] = payment21070 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')1071 self.browser.open(self.student_path + '/bursary_clearance_slip.pdf')1072 self.assertEqual(self.browser.headers['Status'], '200 Ok')1073 self.assertEqual(self.browser.headers['Content-Type'],1074 'application/pdf')1075 path = os.path.join(samples_dir(), 'bursary_clearance_slip.pdf')1076 open(path, 'wb').write(self.browser.contents)1077 print "Sample PDF bursary_clearance_slip.pdf written to %s" % path1078 return
Note: See TracChangeset for help on using the changeset viewer.