Changeset 9662


Ignore:
Timestamp:
17 Nov 2012, 11:50:48 (12 years ago)
Author:
uli
Message:

Add some basic tests for StudentsReports?.

File:
1 edited

Legend:

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

    r9653 r9662  
    11# Tests for student related reports
     2from zope.interface.verify import verifyClass, verifyObject
    23from waeup.kofa.students.reports import (
    3     get_students_by, StudentsReport)
     4    get_students_by, StudentsReport, IStudentsReport)
    45from waeup.kofa.students.tests.test_catalog import CatalogTestSetup
    56from waeup.kofa.testing import FunctionalLayer
     
    1213              'clearance requested', 'cleared', 'school fee paid',
    1314              'returning', 'courses registered', 'courses validated', 'Total')
     15
     16    def test_iface(self):
     17        # ensure we fullfill interface contracts
     18        obj = StudentsReport(2010, 'Undergraduate Full-Time')
     19        verifyClass(IStudentsReport, StudentsReport)
     20        verifyObject(IStudentsReport, obj)
     21        return
     22
     23    def test_repr(self):
     24        # exec(students_report.__repr__()) <=> students_report
     25        obj1 = StudentsReport(2010, 'Undergraduate Full-Time')
     26        self.assertEqual(
     27            obj1.__repr__(),
     28            "StudentsReport(2010, 'Undergraduate Full-Time', author='System')")
     29        obj_from_str = eval(obj1.__repr__())
     30        self.assertEqual(obj_from_str.session, '2010/2011')
     31        self.assertEqual(obj_from_str.mode, 'Undergraduate Full-Time')
     32        return
    1433
    1534    def test_get_students_by_session_simple(self):
Note: See TracChangeset for help on using the changeset viewer.