- Timestamp:
- 13 Jul 2024, 08:43:56 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r17542 r17845 20 20 import tempfile 21 21 import pytz 22 from time import time 22 23 from datetime import datetime, timedelta, date 23 24 from StringIO import StringIO … … 1260 1261 open(path, 'wb').write(self.browser.contents) 1261 1262 print "Sample PDF tiship_slip.pdf written to %s" % path 1263 1264 def test_fiancial_clearance_pdf_slip(self): 1265 payment1 = createObject(u'waeup.StudentOnlinePayment') 1266 timestamp = ("%d" % int(time()*10000))[1:] 1267 payment1.p_id = "LSCNEW-2-4153206270" # the longest possible p_id 1268 payment1.p_category = 'schoolfee' 1269 payment1.p_item = u'My School Fee' 1270 payment1.p_session = 2015 1271 payment1.p_level = 100 1272 payment1.p_current = True 1273 payment1.amount_auth = 23456.9 1274 payment1.approve() 1275 payment2 = createObject(u'waeup.StudentOnlinePayment') 1276 timestamp = ("%d" % int(time()*10000))[1:] 1277 payment2.p_id = "p%s" % timestamp 1278 payment2.p_category = 'clearance' 1279 payment2.p_item = u'My Clearance Fee' 1280 payment2.p_session = 2015 1281 payment2.p_level = 100 1282 payment2.p_current = True 1283 payment2.amount_auth = 5678.6 1284 payment2.approve() 1285 self.student['payments'][payment1.p_id] = payment1 1286 self.student['payments'][payment2.p_id] = payment2 1287 self.student.nysc = True 1288 self.student.nysc_updated = datetime.now(pytz.utc) 1289 self.student.nysc_senate_info = u'Senate Info test' 1290 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1291 self.browser.open(self.student_path + '/clear_financially') 1292 self.browser.getLink("Download fee payment history").click() 1293 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1294 self.assertEqual(self.browser.headers['Content-Type'], 1295 'application/pdf') 1296 path = os.path.join(samples_dir(), 'fee_payment_history.pdf') 1297 open(path, 'wb').write(self.browser.contents) 1298 print "Sample PDF fee_payment_history.pdf written to %s" % path 1299 return
Note: See TracChangeset for help on using the changeset viewer.