Changeset 10550


Ignore:
Timestamp:
28 Aug 2013, 09:43:00 (11 years ago)
Author:
Henrik Bettermann
Message:

Rename StudentsReport? to StudentStatisticsReport?.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students/reports
Files:
2 edited
1 moved

Legend:

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

    r10547 r10550  
    2626from waeup.kofa.reports import IReport
    2727
    28 class IStudentsReport(IReport):
     28class IStudentStatisticsReport(IReport):
    2929
    3030    session = Attribute('Session to report')
     
    118118    ]
    119119
    120 @implementer(IStudentsReport)
    121 class StudentsReport(Report):
     120@implementer(IStudentStatisticsReport)
     121class StudentStatisticsReport(Report):
    122122    data = None
    123123    session = None
     
    125125
    126126    def __init__(self, session, mode, author='System'):
    127         super(StudentsReport, self).__init__(
     127        super(StudentStatisticsReport, self).__init__(
    128128            args=[session, mode], kwargs={'author':author})
    129129        self.session = academic_sessions_vocab.getTerm(session).title
     
    150150
    151151@implementer(IReportGenerator)
    152 class StudentsReportGenerator(grok.GlobalUtility):
     152class StudentStatisticsReportGenerator(grok.GlobalUtility):
    153153
    154154    title = _('Students')
     
    156156
    157157    def generate(self, site, session=None, mode=None, author=None):
    158         result = StudentsReport(session=session, mode=mode, author=author)
     158        result = StudentStatisticsReport(session=session, mode=mode, author=author)
    159159        return result
    160160
     
    168168from waeup.kofa.reports import get_generators
    169169grok.templatedir('browser_templates')
    170 class StudentsReportGeneratorPage(KofaPage):
    171 
    172     grok.context(StudentsReportGenerator)
     170class StudentStatisticsReportGeneratorPage(KofaPage):
     171
     172    grok.context(StudentStatisticsReportGenerator)
    173173    grok.name('index.html')
    174174    grok.require('waeup.manageReports')
     
    215215        return
    216216
    217 class StudentsReportPDFView(grok.View):
    218 
    219     grok.context(IStudentsReport)
     217class StudentStatisticsReportPDFView(grok.View):
     218
     219    grok.context(IStudentStatisticsReport)
    220220    grok.name('pdf')
    221221    grok.require('waeup.Public')
    222222
    223223    def render(self):
    224         filename = 'StudentsReport_%s_%s_%s.pdf' % (
     224        filename = 'StudentStatisticsReport_%s_%s_%s.pdf' % (
    225225            self.context.session, self.context.mode,
    226226            self.context.creation_dt_string)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_reports.py

    r10547 r10550  
    55from zope.component import getUtility
    66from waeup.kofa.interfaces import IJobManager
    7 from waeup.kofa.students.reports import (
    8     get_students_by, StudentsReport, IStudentsReport)
     7from waeup.kofa.students.reports.student_reports import (
     8    get_students_by, StudentStatisticsReport, IStudentStatisticsReport)
    99from waeup.kofa.students.tests.test_catalog import CatalogTestSetup
    1010from waeup.kofa.students.tests.test_browser import StudentsFullSetup
     
    1212from waeup.kofa.tests.test_async import FunctionalAsyncTestCase
    1313
    14 class StudentsReportTests(CatalogTestSetup):
     14class StudentStatisticsReportTests(CatalogTestSetup):
    1515
    1616    layer = FunctionalLayer
     
    2323    def test_iface(self):
    2424        # ensure we fullfill interface contracts
    25         obj = StudentsReport(2010, 'Undergraduate Full-Time')
    26         verifyClass(IStudentsReport, StudentsReport)
    27         verifyObject(IStudentsReport, obj)
     25        obj = StudentStatisticsReport(2010, 'Undergraduate Full-Time')
     26        verifyClass(IStudentStatisticsReport, StudentStatisticsReport)
     27        verifyObject(IStudentStatisticsReport, obj)
    2828        return
    2929
     
    6969    def test_create_pdf(self):
    7070        self.create_cert('FAC2', 'dept2', 'CERT2')
    71         report = StudentsReport(2010, 'Undergraduate Full-Time')
     71        report = StudentStatisticsReport(2010, 'Undergraduate Full-Time')
    7272        result = report.create_pdf()
    7373        self.assertTrue(result.startswith('%PDF-'))
    7474        return
    7575
    76 class StudentsReportUITests(StudentsFullSetup, FunctionalAsyncTestCase):
     76class StudentStatisticsReportUITests(StudentsFullSetup, FunctionalAsyncTestCase):
    7777
    7878    layer = FunctionalLayer
     
    116116                         'application/pdf')
    117117        self.assertTrue(
    118             'filename="StudentsReport_2004_2005_All_' in
     118            'filename="StudentStatisticsReport_2004_2005_All_' in
    119119            self.browser.headers['content-disposition'])
    120120        self.assertEqual(len(self.app['reports'].running_report_jobs), 1)
     
    129129        logcontent = open(logfile).read()
    130130        self.assertTrue(
    131             'INFO - zope.mgr - students.reports.StudentsReportGeneratorPage - '
     131            'INFO - zope.mgr - students.reports.student_reports.StudentStatisticsReportGeneratorPage - '
    132132            'report %s created: Students (session=2004, mode=All)'
    133133            % job_id in logcontent
    134134            )
    135135        self.assertTrue(
    136             'INFO - zope.mgr - students.reports.StudentsReportPDFView - '
    137             'report %s downloaded: StudentsReport_2004_2005_All_'
     136            'INFO - zope.mgr - students.reports.student_reports.StudentStatisticsReportPDFView - '
     137            'report %s downloaded: StudentStatisticsReport_2004_2005_All_'
    138138            % job_id in logcontent
    139139            )
Note: See TracChangeset for help on using the changeset viewer.