Ignore:
Timestamp:
14 Aug 2019, 19:55:53 (5 years ago)
Author:
Henrik Bettermann
Message:

Add FacultiesExportJobContainerSelectStudents view to allow
bursary officers to export student data for a small subset of students
by entering a list of student ids or matric numbers.

File:
1 edited

Legend:

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

    r15508 r15545  
    38123812        self.browser.open(facs_path)
    38133813        self.browser.getLink("Export student data").click()
    3814         self.browser.getControl("Configure new export").click()
     3814        self.browser.getControl("Set export parameters").click()
    38153815        self.browser.getControl(name="exporter").value = ['bursary']
    38163816        self.browser.getControl(name="session").value = ['2004']
     
    38613861            '- discarded: job_id=%s' % job_id in logcontent
    38623862            )
     3863        # Officer can also enter student id and gets the same export file
     3864        self.browser.open(facs_path)
     3865        self.browser.getLink("Export student data").click()
     3866        self.browser.getControl("Enter student ids or matric numbers").click()
     3867        self.browser.getControl(name="exporter").value = ['bursary']
     3868        self.browser.getControl(name="students").value = 'K1000000'
     3869        self.browser.getControl("Create CSV file").click()
     3870        # When the job is finished and we reload the page...
     3871        job_id = self.wait_for_export_job_completed()
     3872        # ... the csv file can be downloaded ...
     3873        self.browser.open('http://localhost/app/faculties/exports')
     3874        self.browser.getLink("Download").click()
     3875        self.assertEqual(self.browser.headers['content-type'],
     3876            'text/csv; charset=UTF-8')
     3877        self.assertTrue(
     3878            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
     3879            self.browser.headers['content-disposition'])
     3880        self.assertTrue(
     3881            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
     3882            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
     3883            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
    38633884
    38643885    def test_faculty_export(self):
     
    38673888        self.browser.open(fac1_path)
    38683889        self.browser.getLink("Export student data").click()
    3869         self.browser.getControl("Configure new export").click()
     3890        self.browser.getControl("Set export parameters").click()
    38703891        self.browser.getControl(name="exporter").value = ['students']
    38713892        self.browser.getControl(name="session").value = ['2004']
     
    38773898        self.browser.getControl(name="payments_end").value = '14/12/2012'
    38783899        self.browser.getControl("Create CSV file").click()
    3879 
    38803900        # When the job is finished and we reload the page...
    38813901        job_id = self.wait_for_export_job_completed()
     
    39223942            '- discarded: job_id=%s' % job_id in logcontent
    39233943            )
     3944        # Officer can set export parameters but cannot enter student id
     3945        # at faculty level
     3946        self.browser.open(fac1_path + '/exports')
     3947        self.assertTrue("Set export parameters"
     3948                         in self.browser.contents)
     3949        self.assertFalse("Enter student ids or matric numbers"
     3950                         in self.browser.contents)
    39243951
    39253952    def test_department_export(self):
     
    39283955        self.browser.open(dep1_path)
    39293956        self.browser.getLink("Export student data").click()
    3930         self.browser.getControl("Configure new export").click()
     3957        self.browser.getControl("Set export parameters").click()
    39313958        self.browser.getControl(name="exporter").value = ['students']
    39323959        self.browser.getControl(name="session").value = ['2004']
     
    39804007        self.browser.open(cert1_path)
    39814008        self.browser.getLink("Export student data").click()
    3982         self.browser.getControl("Configure new export").click()
     4009        self.browser.getControl("Set export parameters").click()
    39834010        self.browser.getControl(name="exporter").value = ['students']
    39844011        self.browser.getControl(name="session").value = ['2004']
     
    40284055        self.browser.open(course1_path)
    40294056        self.browser.getLink("Export student data").click()
    4030         self.browser.getControl("Configure new export").click()
     4057        self.browser.getControl("Set export parameters").click()
    40314058        self.browser.getControl(name="exporter").value = ['students']
    40324059        self.browser.getControl(name="session").value = ['2004']
     
    40814108        self.browser.open(course1_path)
    40824109        self.browser.getLink("Export student data").click()
    4083         self.browser.getControl("Configure new export").click()
     4110        self.browser.getControl("Set export parameters").click()
    40844111        self.assertTrue(
    40854112            'Academic session not set. Please contact the administrator.'
    40864113            in self.browser.contents)
    40874114        self.app['configuration'].current_academic_session = 2004
    4088         self.browser.getControl("Configure new export").click()
     4115        self.browser.getControl("Set export parameters").click()
    40894116        self.browser.getControl(name="exporter").value = ['lecturer']
    40904117        self.browser.getControl(name="session").value = ['2004']
     
    41484175        self.browser.open("http://localhost/app/faculties/fac1/dep1")
    41494176        self.browser.getLink("Export student data").click()
    4150         self.browser.getControl("Configure new export").click()
     4177        self.browser.getControl("Set export parameters").click()
    41514178        # Only the sfpaymentsoverview exporter is available for department officers
    41524179        self.assertFalse('<option value="students">' in self.browser.contents)
     
    41664193
    41674194    def test_export_bursary_officers(self):
     4195        self.add_payment(self.student)
    41684196        # Create bursary officer
    41694197        self.app['users'].addUser('mrbursary', SECRET)
     
    41804208        self.browser.getLink("Academics").click()
    41814209        self.browser.getLink("Export student data").click()
    4182         self.browser.getControl("Configure new export").click()
     4210        self.browser.getControl("Set export parameters").click()
    41834211        # Only the bursary exporter is available for bursary officers
    41844212        # not only at facultiescontainer level ...
     
    41934221        self.browser.open('http://localhost/app/faculties/fac1/dep1')
    41944222        self.browser.getLink("Export student data").click()
    4195         self.browser.getControl("Configure new export").click()
     4223        self.browser.getControl("Set export parameters").click()
    41964224        self.assertFalse('<option value="students">' in self.browser.contents)
    41974225        self.assertTrue('<option value="bursary">' in self.browser.contents)
    4198         # Thew job can be discarded
     4226        # Thew job can be downloaded
    41994227        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
    4200         self.wait_for_export_job_completed()
     4228        job_id = self.wait_for_export_job_completed()
     4229        self.browser.open('http://localhost/app/faculties/exports')
     4230        self.browser.getLink("Download").click()
     4231        self.assertEqual(self.browser.headers['content-type'],
     4232            'text/csv; charset=UTF-8')
     4233        self.assertTrue(
     4234            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
     4235            self.browser.headers['content-disposition'])
     4236        self.assertTrue(
     4237            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
     4238            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
     4239            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
     4240        # ... and discarded
    42014241        self.browser.open('http://localhost/app/faculties/exports')
    42024242        self.browser.getControl("Discard").click()
    42034243        self.assertEqual(len(self.app['datacenter'].running_exports), 0)
     4244        # At Academics level bursary officers can also enter student ids
     4245        self.browser.getLink("Academics").click()
     4246        self.browser.getLink("Export student data").click()
     4247        self.browser.getControl("Enter student ids or matric numbers").click()
     4248        self.assertFalse('<option value="students">' in self.browser.contents)
     4249        self.browser.getControl(name="exporter").value = ['bursary']
     4250        self.browser.getControl(name="students").value = 'K1000000'
     4251        self.browser.getControl("Create CSV file").click()
     4252        # When the job is finished and we reload the page...
     4253        job_id = self.wait_for_export_job_completed()
     4254        # ... the csv file can be downloaded ...
     4255        self.browser.open('http://localhost/app/faculties/exports')
     4256        self.browser.getLink("Download").click()
     4257        self.assertEqual(self.browser.headers['content-type'],
     4258            'text/csv; charset=UTF-8')
     4259        self.assertTrue(
     4260            'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in
     4261            self.browser.headers['content-disposition'])
     4262        self.assertTrue(
     4263            '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,'
     4264            'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,'
     4265            'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents)
    42044266
    42054267    def test_export_accommodation_officers(self):
     
    42184280        self.browser.getLink("Academics").click()
    42194281        self.browser.getLink("Export student data").click()
    4220         self.browser.getControl("Configure new export").click()
     4282        self.browser.getControl("Set export parameters").click()
    42214283        # accommodationpayments and beds exporters are available
    42224284        # not only at facultiescontainer level ...
     
    42344296        self.browser.open('http://localhost/app/faculties/fac1/dep1')
    42354297        self.browser.getLink("Export student data").click()
    4236         self.browser.getControl("Configure new export").click()
     4298        self.browser.getControl("Set export parameters").click()
    42374299        self.assertFalse('<option value="students">' in self.browser.contents)
    42384300        self.assertTrue('<option value="accommodationpayments">'
Note: See TracChangeset for help on using the changeset viewer.