- Timestamp:
- 21 Jan 2017, 13:45:59 (8 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_level_report.py
r14392 r14423 18 18 def test_iface(self): 19 19 # ensure we fullfill interface contracts 20 obj = LevelReport('fac1', 'dep1', 2010, 100)20 obj = LevelReport('fac1', 'dep1', 'CERT1', 2010, 100) 21 21 verifyClass(ILevelReport, LevelReport) 22 22 verifyObject(ILevelReport, obj) … … 39 39 self.student['studycourse']['100']['Course3'] = ticket 40 40 # we can get a table with one student 41 result = get_students('fac1', 'dep1', 2010, 100) 41 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100) 42 self.assertEqual(result, 43 [(u'1234', u'Bob Tester', 90, 30, '1.666', 44 'm_Course2_m Course3', '', 90, 30, '1.666', '')]) 45 # same result when selecting all certificates 46 result = get_students('fac1', 'dep1', 'all', 2010, 100) 42 47 self.assertEqual(result, 43 48 [(u'1234', u'Bob Tester', 90, 30, '1.666', … … 72 77 ticket4.credits = 30 73 78 self.student['studycourse']['100']['Course6'] = ticket4 74 report = LevelReport('fac1', 'dep1', 2010, 100)79 report = LevelReport('fac1', 'dep1', 'all', 2010, 100) 75 80 result = report.create_pdf('JOB_ID') 76 81 self.assertTrue(result.startswith('%PDF-')) … … 108 113 self.browser.getControl(name="level").value = ['100'] 109 114 self.browser.getControl(name="session").value = ['2010'] 110 self.browser.getControl(name="faccode_depcode").value = ['fac1_dep1'] 115 self.browser.getControl(name="faccode_depcode_certcode").value = [ 116 'fac1_dep1_CERT1'] 111 117 self.browser.getControl("Create").click() 112 118 return … … 123 129 'application/pdf') 124 130 self.assertTrue( 125 'filename="LevelReport_fac1_dep1_ 2010_100_' in131 'filename="LevelReport_fac1_dep1_CERT1_2010_100_' in 126 132 self.browser.headers['content-disposition']) 127 133 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) … … 137 143 self.assertTrue( 138 144 'INFO - zope.mgr - students.reports.level_report.LevelReportGeneratorPage - ' 139 'report %s created: Level Report (faculty=fac1, department=dep1, session=2010, level=100)' 145 'report %s created: Level Report (faculty=fac1, department=dep1, ' 146 'certificate=CERT1, session=2010, level=100)' 140 147 % job_id in logcontent 141 148 ) 142 149 self.assertTrue( 143 150 'INFO - zope.mgr - students.reports.level_report.LevelReportPDFView - ' 144 'report %s downloaded: LevelReport_fac1_dep1_ 2010_100_'151 'report %s downloaded: LevelReport_fac1_dep1_CERT1_2010_100_' 145 152 % job_id in logcontent 146 153 ) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py
r14410 r14423 20 20 def test_iface(self): 21 21 # ensure we fullfill interface contracts 22 obj = SessionResultsPresentation('fac1', 'dep1', 2010, 100)22 obj = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 23 23 verifyClass(ISessionResultsPresentation, SessionResultsPresentation) 24 24 verifyObject(ISessionResultsPresentation, obj) … … 26 26 27 27 def test_get_students(self): 28 result = get_students('fac1', 'dep1', 2010, 100)28 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100) 29 29 self.assertEqual(result, 30 30 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) … … 32 32 33 33 def test_get_students_at_all_levels(self): 34 result = get_students('fac1', 'dep1', 2010, 0) 34 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 35 self.assertEqual(result, 36 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) 37 return 38 39 def test_get_students_all_certs(self): 40 result = get_students('fac1', 'dep1', 'all', 2010, 100) 35 41 self.assertEqual(result, 36 42 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) … … 43 49 studylevel.level_session = 2010 44 50 self.student['studycourse']['200'] = studylevel 45 result = get_students('fac1', 'dep1', 2010, 0)51 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 46 52 self.assertEqual(result, 47 53 [[], [], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')]]) … … 50 56 def test_get_students_without_scores(self): 51 57 self.student['studycourse']['100']['Course1'].score = None 52 result = get_students('fac1', 'dep1', 2010, 0)58 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 53 59 self.assertEqual(result, 54 60 [[], [], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')]]) … … 56 62 def test_get_students_without_level_in_session(self): 57 63 self.student['studycourse']['100'].level_session = 2011 58 result = get_students('fac1', 'dep1', 2010)64 result = get_students('fac1', 'dep1', 'CERT1', 2010) 59 65 self.assertEqual(result, 60 66 [[], [], [], [], [], [], []]) … … 62 68 63 69 def test_create_pdf(self): 64 report = SessionResultsPresentation('fac1', 'dep1', 2010, 100)70 report = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 65 71 result = report.create_pdf('JOB_ID') 66 72 self.assertTrue(result.startswith('%PDF-')) … … 80 86 self.student['studycourse']['620'] = studylevel 81 87 self.student['studycourse']['620']['Course2'] = ticket 82 report = SessionResultsPresentation('fac1', 'dep1', 2013, 620)88 report = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2013, 620) 83 89 result = report.create_pdf('JOB_ID') 84 90 self.assertTrue(result.startswith('%PDF-')) … … 101 107 self.student['studycourse']['200'] = studylevel 102 108 self.student['studycourse']['200']['Course2'] = ticket 103 report = SessionResultsPresentation('fac1', 'dep1', 2010, 0)109 report = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 0) 104 110 result = report.create_pdf('JOB_ID') 105 111 self.assertTrue(result.startswith('%PDF-')) … … 137 143 self.browser.getControl(name="level").value = [level] 138 144 self.browser.getControl(name="session").value = ['2010'] 139 self.browser.getControl(name="faccode_depcode ").value = ['fac1_dep1']145 self.browser.getControl(name="faccode_depcode_certcode").value = ['fac1_dep1_CERT1'] 140 146 self.browser.getControl("Create").click() 141 147 return … … 152 158 'application/pdf') 153 159 self.assertTrue( 154 'filename="SessionResultsPresentation_fac1_dep1_ 2010_100_' in160 'filename="SessionResultsPresentation_fac1_dep1_CERT1_2010_100_' in 155 161 self.browser.headers['content-disposition']) 156 162 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) … … 166 172 self.assertTrue( 167 173 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationGeneratorPage - ' 168 'report %s created: Session Results Presentation (faculty=fac1, department=dep1, session=2010, level=100)' 174 'report %s created: Session Results Presentation ' 175 '(faculty=fac1, department=dep1, certificate=CERT1, session=2010, level=100)' 169 176 % job_id in logcontent 170 177 ) 171 178 self.assertTrue( 172 179 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - ' 173 'report %s downloaded: SessionResultsPresentation_fac1_dep1_ 2010_100_'180 'report %s downloaded: SessionResultsPresentation_fac1_dep1_CERT1_2010_100_' 174 181 % job_id in logcontent 175 182 ) … … 192 199 'application/pdf') 193 200 self.assertTrue( 194 'filename="SessionResultsPresentation_fac1_dep1_ 2010_0_' in201 'filename="SessionResultsPresentation_fac1_dep1_CERT1_2010_0_' in 195 202 self.browser.headers['content-disposition']) 196 203 self.assertEqual(len(self.app['reports'].running_report_jobs), 1) … … 206 213 self.assertTrue( 207 214 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationGeneratorPage - ' 208 'report %s created: Session Results Presentation (faculty=fac1, department=dep1, session=2010, level=0)' 215 'report %s created: Session Results Presentation ' 216 '(faculty=fac1, department=dep1, certificate=CERT1, session=2010, level=0)' 209 217 % job_id in logcontent 210 218 ) 211 219 self.assertTrue( 212 220 'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - ' 213 'report %s downloaded: SessionResultsPresentation_fac1_dep1_ 2010_0_'221 'report %s downloaded: SessionResultsPresentation_fac1_dep1_CERT1_2010_0_' 214 222 % job_id in logcontent 215 223 )
Note: See TracChangeset for help on using the changeset viewer.