Changeset 12632 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 26 Feb 2015, 07:35:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r12518 r12632 3299 3299 self.assertTrue( 3300 3300 'zope.mgr - students.browser.DatacenterExportJobContainerJobConfig ' 3301 '- exported: bursary (2004, 100, ug_ft, None, None, '3301 '- exported: bursary (2004, 100, ug_ft, None, None, None, ' 3302 3302 '13/12/2012, 14/12/2012), job_id=%s' 3303 3303 % job_id in logcontent … … 3389 3389 self.assertTrue( 3390 3390 'zope.mgr - students.browser.FacultiesExportJobContainerJobConfig ' 3391 '- exported: bursary (2004, 100, ug_ft, None, None, '3391 '- exported: bursary (2004, 100, ug_ft, None, None, None, ' 3392 3392 '13/12/2012, 14/12/2012), job_id=%s' 3393 3393 % job_id in logcontent … … 3396 3396 'zope.mgr - students.browser.ExportJobContainerDownload ' 3397 3397 '- downloaded: WAeUP.Kofa_bursary_%s.csv, job_id=%s' 3398 % (job_id, job_id) in logcontent 3399 ) 3400 self.assertTrue( 3401 'zope.mgr - students.browser.ExportJobContainerOverview ' 3402 '- discarded: job_id=%s' % job_id in logcontent 3403 ) 3404 3405 def test_faculty_export(self): 3406 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 3407 fac1_path = 'http://localhost/app/faculties/fac1' 3408 self.browser.open(fac1_path) 3409 self.browser.getLink("Export student data").click() 3410 self.browser.getControl("Configure new export").click() 3411 self.browser.getControl(name="exporter").value = ['students'] 3412 self.browser.getControl(name="session").value = ['2004'] 3413 self.browser.getControl(name="level").value = ['100'] 3414 self.browser.getControl(name="mode").value = ['ug_ft'] 3415 # The testbrowser does not hide the payment period fields, but 3416 # values are ignored when using the students exporter. 3417 self.browser.getControl(name="payments_start").value = '13/12/2012' 3418 self.browser.getControl(name="payments_end").value = '14/12/2012' 3419 self.browser.getControl("Create CSV file").click() 3420 3421 # When the job is finished and we reload the page... 3422 job_id = self.wait_for_export_job_completed() 3423 self.browser.open(fac1_path + '/exports') 3424 # ... the csv file can be downloaded ... 3425 self.browser.getLink("Download").click() 3426 self.assertEqual(self.browser.headers['content-type'], 3427 'text/csv; charset=UTF-8') 3428 self.assertTrue( 3429 'filename="WAeUP.Kofa_students_%s.csv' % job_id in 3430 self.browser.headers['content-disposition']) 3431 self.assertTrue( 3432 'adm_code,clearance_locked,clr_code,date_of_birth,email,employer,' 3433 'firstname,lastname,matric_number,middlename,nationality,' 3434 'officer_comment,perm_address,personal_updated,phone,reg_number,' 3435 'sex,student_id,suspended,suspended_comment,transcript_comment,' 3436 'password,state,history,certcode,is_postgrad,current_level,' 3437 'current_session\r\n' 3438 ',1,,1981-02-04#,aa@aa.ng,,Anna,Tester,234,,,,,,' 3439 '1234#,123,m,K1000000,0,,,{SSHA}' in self.browser.contents) 3440 self.assertEqual(len(self.app['datacenter'].running_exports), 1) 3441 job_id = self.app['datacenter'].running_exports[0][0] 3442 # ... and discarded 3443 self.browser.open(fac1_path + '/exports') 3444 self.browser.getControl("Discard").click() 3445 self.assertEqual(len(self.app['datacenter'].running_exports), 0) 3446 # Creation, downloading and discarding is logged 3447 logfile = os.path.join( 3448 self.app['datacenter'].storage, 'logs', 'datacenter.log') 3449 logcontent = open(logfile).read() 3450 self.assertTrue( 3451 'zope.mgr - students.browser.FacultyExportJobContainerJobConfig ' 3452 '- exported: students (2004, 100, ug_ft, fac1, None, None, ' 3453 '13/12/2012, 14/12/2012), job_id=%s' 3454 % job_id in logcontent 3455 ) 3456 self.assertTrue( 3457 'zope.mgr - students.browser.ExportJobContainerDownload ' 3458 '- downloaded: WAeUP.Kofa_students_%s.csv, job_id=%s' 3398 3459 % (job_id, job_id) in logcontent 3399 3460 ) … … 3441 3502 self.assertTrue( 3442 3503 'zope.mgr - students.browser.DepartmentExportJobContainerJobConfig ' 3443 '- exported: students (2004, 100, ug_ft, dep1, None, '3504 '- exported: students (2004, 100, ug_ft, None, dep1, None, ' 3444 3505 '13/12/2012, 14/12/2012), job_id=%s' 3445 3506 % job_id in logcontent … … 3488 3549 self.assertTrue( 3489 3550 'zope.mgr - students.browser.CertificateExportJobContainerJobConfig ' 3490 '- exported: students (2004, 100, None, None, CERT1, None, None), '3551 '- exported: students (2004, 100, None, None, None, CERT1, None, None), ' 3491 3552 'job_id=%s' 3492 3553 % job_id in logcontent
Note: See TracChangeset for help on using the changeset viewer.