Ignore:
Timestamp:
24 Jan 2015, 18:30:11 (10 years ago)
Author:
Henrik Bettermann
Message:

Student statistic can now be broken down by faculties or by departments.

File:
1 edited

Legend:

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

    r12110 r12515  
    2424    def test_iface(self):
    2525        # ensure we fullfill interface contracts
    26         obj = StudentStatisticsReport(2010, 'Undergraduate Full-Time')
     26        obj = StudentStatisticsReport(
     27            2010, 'Undergraduate Full-Time', 'faccode')
    2728        verifyClass(IStudentStatisticsReport, StudentStatisticsReport)
    2829        verifyObject(IStudentStatisticsReport, obj)
     
    3132    def test_get_student_stats_session_simple(self):
    3233        # we can get a table with one student
    33         result1 = get_student_stats(2010, 'Undergraduate Full-Time')
    34         result2 = get_student_stats(2009, 'Undergraduate Full-Time')
     34        result1 = get_student_stats(2010, 'Undergraduate Full-Time', 'faccode')
     35        result2 = get_student_stats(2009, 'Undergraduate Full-Time', 'faccode')
    3536        self.assertEqual(
    3637            result1,
     
    4950    def test_get_student_stats_session_multiple(self):
    5051        # we can get a table with several students
    51         self.create_cert(u'fac2', u'dept2', u'CERT2')
    52         result1 = get_student_stats(2010, 'Undergraduate Full-Time')
    53         result2 = get_student_stats(2009, 'Undergraduate Full-Time')
     52        self.create_cert(u'fac2', u'dep2', u'CERT2')
     53        result1 = get_student_stats(2010, 'Undergraduate Full-Time', 'faccode')
     54        result2 = get_student_stats(2009, 'Undergraduate Full-Time', 'faccode')
    5455        self.assertEqual(
    5556            result1,
     
    6869        return
    6970
     71    def test_get_student_stats_session_multiple_dep_breakdown(self):
     72        # we can get a table with several students
     73        self.create_cert(u'fac2', u'dep2', u'CERT2')
     74        result1 = get_student_stats(2010, 'Undergraduate Full-Time', 'depcode')
     75        result2 = get_student_stats(2009, 'Undergraduate Full-Time', 'depcode')
     76        self.assertEqual(
     77            result1,
     78            ((u'dep1', u'dep2', u'Total'),
     79             self.states,
     80             ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),
     81              (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
     82              (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),)))
     83        self.assertEqual(
     84            result2,
     85            ((u'dep1', u'dep2', u'Total'),
     86             self.states,
     87             ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
     88              (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
     89              (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),)))
     90        return
     91
    7092    def test_create_pdf(self):
    7193        self.create_cert(u'FAC2', u'dept2', u'CERT2')
    72         report = StudentStatisticsReport(2010, 'Undergraduate Full-Time')
     94        report = StudentStatisticsReport(
     95            2010, 'Undergraduate Full-Time', 'faccode')
    7396        result = report.create_pdf()
    7497        self.assertTrue(result.startswith('%PDF-'))
     
    104127        self.browser.getControl(name="generator").value = ['student_stats']
    105128        self.browser.getControl("Configure").click()
     129        self.browser.getControl(name="breakdown").value = ['depcode']
    106130        self.browser.getControl(name="mode").value = ['All']
    107131        self.browser.getControl(name="session").value = ['2004']
     
    134158        self.assertTrue(
    135159            'INFO - zope.mgr - students.reports.student_statistics.StudentStatisticsReportGeneratorPage - '
    136             'report %s created: Student Statistics (session=2004, mode=All)'
     160            'report %s created: Student Statistics (session=2004, mode=All, breakdown=depcode)'
    137161            % job_id in logcontent
    138162            )
Note: See TracChangeset for help on using the changeset viewer.