- Timestamp:
- 7 Mar 2017, 06:51:42 (8 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14529 r14605 5 5 from waeup.kofa.interfaces import IJobManager 6 6 from waeup.kofa.students.reports.level_report import ( 7 get_students,LevelReport, ILevelReport)7 LevelReport, ILevelReport) 8 8 from waeup.kofa.students.tests.test_catalog import CatalogTestSetup 9 9 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 65 65 self._add_tickets() 66 66 # we can get a table with one student 67 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100) 67 lr = LevelReport('fac1', 'dep1', 'CERT1', 2010, 100) 68 result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100) 68 69 self.assertEqual(result, 69 70 [(u'1234', u'Bob Tester', 90, 30, '1.666', … … 71 72 90, 30, '1.666', '')]) 72 73 # same result when selecting all certificates 73 result = get_students('fac1', 'dep1', 'all', 2010, 100)74 result = lr._get_students('fac1', 'dep1', 'all', 2010, 100) 74 75 self.assertEqual(result, 75 76 [(u'1234', u'Bob Tester', 90, 30, '1.666', -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_raw_score_report.py
r14505 r14605 10 10 from waeup.kofa.browser.tests.test_pdf import samples_dir 11 11 from waeup.kofa.students.reports.raw_score_report import ( 12 get_students, RawScoreReport, IRawScoreReport, 13 get_courses) 12 RawScoreReport, IRawScoreReport) 14 13 15 14 … … 37 36 def test_get_courses(self): 38 37 # we can get a list with one course code 39 result = get_courses('fac1', 'dep1', 'CERT1', 2010, 100) 38 rsr = RawScoreReport('fac1', 'dep1', 'CERT1', 2010, 100) 39 result = rsr._get_courses('fac1', 'dep1', 'CERT1', 2010, 100) 40 40 self.assertEqual(result, [(u'Course1')]) 41 41 return … … 43 43 def test_get_students(self): 44 44 # we can get a table with one student 45 course_codes = get_courses('fac1', 'dep1', 'CERT1', 2010, 100) 46 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes) 45 rsr = RawScoreReport('fac1', 'dep1', 'CERT1', 2010, 100) 46 course_codes = rsr._get_courses('fac1', 'dep1', 'CERT1', 2010, 100) 47 result = rsr._get_students( 48 'fac1', 'dep1', 'CERT1', 2010, 100, course_codes) 47 49 self.assertEqual(result, 48 50 [(u'1234', u'Bob Tester', {'Course1': (70, 'A')})]) 49 51 self.student['studycourse']['100']['Course1'].score = None 50 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes) 52 result = rsr._get_students( 53 'fac1', 'dep1', 'CERT1', 2010, 100, course_codes) 51 54 self.assertEqual(result, 52 55 [(u'1234', u'Bob Tester', {'Course1': ('Nil', '')})]) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py
r14514 r14605 6 6 from waeup.kofa.interfaces import IJobManager 7 7 from waeup.kofa.students.reports.session_results_presentation import ( 8 get_students,SessionResultsPresentation, ISessionResultsPresentation)8 SessionResultsPresentation, ISessionResultsPresentation) 9 9 from waeup.kofa.students.tests.test_catalog import CatalogTestSetup 10 10 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 26 26 27 27 def test_get_students(self): 28 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100) 28 sr = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 29 result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 100) 29 30 self.assertEqual(result, 30 31 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) … … 32 33 33 34 def test_get_students_at_all_levels(self): 34 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 35 sr = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 36 result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 0) 35 37 self.assertEqual(result, 36 38 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) … … 38 40 39 41 def test_get_students_all_certs(self): 40 result = get_students('fac1', 'dep1', 'all', 2010, 100) 42 sr = SessionResultsPresentation('fac1', 'dep1', 'all', 2010, 100) 43 result = sr._get_students('fac1', 'dep1', 'all', 2010, 100) 41 44 self.assertEqual(result, 42 45 [[], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')], []]) … … 49 52 studylevel.level_session = 2010 50 53 self.student['studycourse']['200'] = studylevel 51 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 54 sr = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 55 result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 0) 52 56 self.assertEqual(result, 53 57 [[], [], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')]]) … … 56 60 def test_get_students_without_scores(self): 57 61 self.student['studycourse']['100']['Course1'].score = None 58 result = get_students('fac1', 'dep1', 'CERT1', 2010, 0) 62 sr = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 63 result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 0) 59 64 self.assertEqual(result, 60 65 [[], [], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')]]) … … 62 67 def test_get_students_without_level_in_session(self): 63 68 self.student['studycourse']['100'].level_session = 2011 64 result = get_students('fac1', 'dep1', 'CERT1', 2010) 69 sr = SessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100) 70 result = sr._get_students('fac1', 'dep1', 'CERT1', 2010) 65 71 self.assertEqual(result, 66 72 [[], [], [], [], [], [], []])
Note: See TracChangeset for help on using the changeset viewer.