- Timestamp:
- 1 May 2015, 14:32:09 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py
r12564 r12897 22 22 # ensure we fullfill interface contracts 23 23 obj = StudentPaymentStatisticsReport( 24 2010, 'Undergraduate Full-Time', 'faccode')24 2010, 'Undergraduate Full-Time', 0, 'faccode') 25 25 verifyClass(IStudentPaymentStatisticsReport, StudentPaymentStatisticsReport) 26 26 verifyObject(IStudentPaymentStatisticsReport, obj) … … 29 29 def test_get_student_payment_stats_session_simple(self): 30 30 # we can get a table with one student 31 result1 = get_student_payment_stats(2010, 'Undergraduate Full-Time', 'faccode') 32 result2 = get_student_payment_stats(2009, 'Undergraduate Full-Time', 'faccode') 31 result1 = get_student_payment_stats( 32 2010, 'Undergraduate Full-Time', 0, 'faccode') 33 result2 = get_student_payment_stats( 34 2009, 'Undergraduate Full-Time', 0, 'faccode') 33 35 self.assertEqual( 34 36 result1, … … 53 55 def test_create_pdf(self): 54 56 report = StudentPaymentStatisticsReport( 55 2010, 'Undergraduate Full-Time', 'faccode')57 2010, 'Undergraduate Full-Time', 0, 'faccode') 56 58 result = report.create_pdf() 57 59 self.assertTrue(result.startswith('%PDF-')) … … 104 106 'application/pdf') 105 107 self.assertTrue( 106 'filename="StudentPaymentStatisticsReport_2004_2005_All_ ' in108 'filename="StudentPaymentStatisticsReport_2004_2005_All__' in 107 109 self.browser.headers['content-disposition']) 108 110 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) … … 118 120 self.assertTrue( 119 121 'INFO - zope.mgr - students.reports.student_payment_statistics.StudentPaymentStatisticsReportGeneratorPage - ' 120 'report %s created: Student Payment Statistics (session=2004, mode=All, breakdown=depcode)'122 'report %s created: Student Payment Statistics (session=2004, mode=All, level=0, breakdown=depcode)' 121 123 % job_id in logcontent 122 124 ) 123 125 self.assertTrue( 124 126 'INFO - zope.mgr - students.reports.student_payment_statistics.StudentPaymentStatisticsReportPDFView - ' 125 'report %s downloaded: StudentPaymentStatisticsReport_2004_2005_All_ '127 'report %s downloaded: StudentPaymentStatisticsReport_2004_2005_All__' 126 128 % job_id in logcontent 127 129 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r12619 r12897 25 25 # ensure we fullfill interface contracts 26 26 obj = StudentStatisticsReport( 27 2010, 'Undergraduate Full-Time', 'faccode')27 2010, 'Undergraduate Full-Time', 0, 'faccode') 28 28 verifyClass(IStudentStatisticsReport, StudentStatisticsReport) 29 29 verifyObject(IStudentStatisticsReport, obj) … … 32 32 def test_get_student_stats_session_simple(self): 33 33 # we can get a table with one student 34 result1 = get_student_stats(2010, 'Undergraduate Full-Time', 'faccode') 35 result2 = get_student_stats(2009, 'Undergraduate Full-Time', 'faccode') 34 result1 = get_student_stats( 35 2010, 'Undergraduate Full-Time', 0, 'faccode') 36 result2 = get_student_stats( 37 2009, 'Undergraduate Full-Time', 0, 'faccode') 36 38 self.assertEqual( 37 39 result1, … … 51 53 # we can get a table with several students 52 54 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') 55 result1 = get_student_stats( 56 2010, 'Undergraduate Full-Time', 0, 'faccode') 57 result2 = get_student_stats( 58 2009, 'Undergraduate Full-Time', 0, 'faccode') 55 59 self.assertEqual( 56 60 result1, … … 72 76 # we can get a table with several students 73 77 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') 78 result1 = get_student_stats(2010, 'Undergraduate Full-Time', 0, 'depcode') 79 result2 = get_student_stats(2009, 'Undergraduate Full-Time', 0, 'depcode') 80 self.assertEqual( 81 result1, 82 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 83 self.states, 84 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), 85 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 86 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),))) 87 self.assertEqual( 88 result2, 89 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 90 self.states, 91 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 92 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 93 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),))) 94 return 95 96 def test_get_student_stats_session_multiple_dep_breakdown_level_100(self): 97 # we can get a table with several students 98 self.create_cert(u'fac2', u'dep2', u'CERT2') 99 result1 = get_student_stats(2010, 'Undergraduate Full-Time', 0, 'depcode') 100 result2 = get_student_stats(2009, 'Undergraduate Full-Time', 0, 'depcode') 76 101 self.assertEqual( 77 102 result1, … … 93 118 self.create_cert(u'FAC2', u'dept2', u'CERT2') 94 119 report = StudentStatisticsReport( 95 2010, 'Undergraduate Full-Time', 'faccode')120 2010, 'Undergraduate Full-Time', 0, 'faccode') 96 121 result = report.create_pdf() 97 122 self.assertTrue(result.startswith('%PDF-')) … … 99 124 open(path, 'wb').write(result) 100 125 print "Sample PDF student_statistics.pdf written to %s" % path 126 return 127 128 def test_create_100level_pdf(self): 129 self.create_cert(u'FAC2', u'dept2', u'CERT2') 130 report = StudentStatisticsReport( 131 2010, 'Undergraduate Full-Time', 100, 'faccode') 132 result = report.create_pdf() 133 self.assertTrue(result.startswith('%PDF-')) 134 path = os.path.join(samples_dir(), 'student_statistics_100.pdf') 135 open(path, 'wb').write(result) 136 print "Sample PDF student_statistics_100.pdf written to %s" % path 101 137 return 102 138 … … 158 194 self.assertTrue( 159 195 'INFO - zope.mgr - students.reports.student_statistics.StudentStatisticsReportGeneratorPage - ' 160 'report %s created: Student Statistics (session=2004, mode=All, breakdown=depcode)'196 'report %s created: Student Statistics (session=2004, mode=All, level=0, breakdown=depcode)' 161 197 % job_id in logcontent 162 198 ) 163 199 self.assertTrue( 164 200 'INFO - zope.mgr - students.reports.student_statistics.StudentStatisticsReportPDFView - ' 165 'report %s downloaded: StudentStatisticsReport_2004_2005_All_ '201 'report %s downloaded: StudentStatisticsReport_2004_2005_All__' 166 202 % job_id in logcontent 167 203 )
Note: See TracChangeset for help on using the changeset viewer.