- Timestamp:
- 24 Jan 2015, 18:30:11 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r12110 r12515 24 24 def test_iface(self): 25 25 # ensure we fullfill interface contracts 26 obj = StudentStatisticsReport(2010, 'Undergraduate Full-Time') 26 obj = StudentStatisticsReport( 27 2010, 'Undergraduate Full-Time', 'faccode') 27 28 verifyClass(IStudentStatisticsReport, StudentStatisticsReport) 28 29 verifyObject(IStudentStatisticsReport, obj) … … 31 32 def test_get_student_stats_session_simple(self): 32 33 # 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') 35 36 self.assertEqual( 36 37 result1, … … 49 50 def test_get_student_stats_session_multiple(self): 50 51 # we can get a table with several students 51 self.create_cert(u'fac2', u'dep t2', 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') 54 55 self.assertEqual( 55 56 result1, … … 68 69 return 69 70 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 70 92 def test_create_pdf(self): 71 93 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') 73 96 result = report.create_pdf() 74 97 self.assertTrue(result.startswith('%PDF-')) … … 104 127 self.browser.getControl(name="generator").value = ['student_stats'] 105 128 self.browser.getControl("Configure").click() 129 self.browser.getControl(name="breakdown").value = ['depcode'] 106 130 self.browser.getControl(name="mode").value = ['All'] 107 131 self.browser.getControl(name="session").value = ['2004'] … … 134 158 self.assertTrue( 135 159 '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)' 137 161 % job_id in logcontent 138 162 )
Note: See TracChangeset for help on using the changeset viewer.