Ignore:
Timestamp:
6 Jan 2013, 21:43:17 (12 years ago)
Author:
Henrik Bettermann
Message:

Implement student data export configuration page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py

    r9827 r9835  
    278278                         in self.browser.contents)
    279279
     280    def test_export_students(self):
     281        # we can trigger export file creation
     282        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     283        self.browser.open(self.datacenter_path)
     284        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     285        self.assertEqual(self.browser.url, self.datacenter_path)
     286        self.browser.getLink("Export data").click()
     287        self.browser.getLink("configuration page").click()
     288        self.browser.getControl(name="exporter").value = ['students']
     289        self.browser.getControl(name="session").value = ['all']
     290        self.browser.getControl(name="level").value = ['all']
     291        self.browser.getControl(name="mode").value = ['all']
     292        self.browser.getControl("Create CSV file").click()
     293        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     294        job_id = self.wait_for_export_job_completed()
     295        self.browser.open(self.datacenter_path + '/export')
     296        self.browser.getLink("Download").click()
     297        self.assertEqual(self.browser.headers['content-type'],
     298                         'text/csv; charset=UTF-8')
     299        self.assertEqual(self.browser.headers['content-disposition'],
     300                         'attachment; filename="WAeUP.Kofa_students.csv')
     301        # No students yet
     302        self.assertEqual(self.browser.contents,
     303            'adm_code,clearance_locked,clr_code,date_of_birth,email,'
     304            'employer,firstname,lastname,matric_number,middlename,'
     305            'nationality,officer_comment,perm_address,personal_updated,'
     306            'phone,reg_number,sex,student_id,suspended,suspended_comment,'
     307            'password,state,history,certcode,is_postgrad,current_level,'
     308            'current_session\r\n')
     309        self.cleanup_run_job()
     310        return
     311
    280312    def test_export_discard(self):
    281313        # we can discard a generated export result
Note: See TracChangeset for help on using the changeset viewer.