- Timestamp:
- 11 May 2016, 06:37:34 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_student_level_statistics.py
r13857 r13858 18 18 layer = FunctionalLayer 19 19 20 levels = (100, 200, 300, 400, 500, 'Total') 20 levels = (u'100 male', u'100 female', u'200 male', u'200 female', u'300 male', u'300 female', 21 u'400 male', u'400 female', u'500 male', u'500 female', u'Total male', u'Total female') 21 22 22 23 def test_iface(self): … … 28 29 29 30 def test_get_student_stats_session_simple(self): 31 self.student['studycourse'].current_level = 110 32 self.student.sex = 'm' 30 33 # we can get a table with one student 31 34 result1 = get_student_stats(2010, 'faccode') … … 35 38 ((u'fac1', u'Total',), 36 39 self.levels, 37 ((1, 0, 0, 0, 0, 1),38 (1, 0, 0, 0, 0, 1),)39 40 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), 41 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)) 42 )) 40 43 self.assertEqual( 41 44 result2, 42 45 ((u'fac1', u'Total'), 43 46 self.levels, 44 ((0, 0, 0, 0, 0, 0 ),45 (0, 0, 0, 0, 0, 0 ),)46 47 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 48 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) 49 )) 47 50 return 48 51 49 52 def test_get_student_stats_session_multiple(self): 50 # we can get a table with several students53 # we can get a table with several faculties 51 54 self.create_cert(u'fac2', u'dep2', u'CERT2') 55 self.student.sex = 'm' 52 56 result1 = get_student_stats(2010, 'faccode') 53 57 result2 = get_student_stats(2009, 'faccode') … … 56 60 ((u'fac1', u'fac2', u'Total'), 57 61 self.levels, 58 ((1, 0, 0, 0, 0, 1),59 (0, 0, 0, 0, 0, 0 ),60 (1, 0, 0, 0, 0, 1),)61 62 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), 63 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 64 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)) 65 )) 62 66 self.assertEqual( 63 67 result2, 64 68 ((u'fac1', u'fac2', u'Total'), 65 69 self.levels, 66 ((0, 0, 0, 0, 0, 0 ),67 (0, 0, 0, 0, 0, 0 ),68 (0, 0, 0, 0, 0, 0 ),)69 70 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 71 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 72 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) 73 )) 70 74 return 71 75 … … 73 77 # we can get a table with several students 74 78 self.create_cert(u'fac2', u'dep2', u'CERT2') 79 self.student.sex = 'm' 75 80 result1 = get_student_stats(2010, 'depcode') 76 81 result2 = get_student_stats(2009, 'depcode') … … 79 84 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 80 85 self.levels, 81 ((1, 0, 0, 0, 0, 1),82 (0, 0, 0, 0, 0, 0 ),83 (1, 0, 0, 0, 0, 1),)86 ((1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), 87 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 88 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)) 84 89 )) 85 90 self.assertEqual( … … 87 92 ((u'fac1/dep1', u'fac2/dep2', u'Total'), 88 93 self.levels, 89 ((0, 0, 0, 0, 0, 0 ),90 (0, 0, 0, 0, 0, 0 ),91 (0, 0, 0, 0, 0, 0 ),)94 ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 95 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 96 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) 92 97 )) 93 98 return 94 99 95 100 def test_create_pdf(self): 101 self.student.sex = 'm' 96 102 self.create_cert(u'FAC2', u'dept2', u'CERT2') 97 report = StudentLevelStatisticsReport(2010, 'faccode') 103 self.student['studycourse'].current_level = 220 104 report = StudentLevelStatisticsReport(2010, 'depcode') 98 105 result = report.create_pdf() 99 106 self.assertTrue(result.startswith('%PDF-'))
Note: See TracChangeset for help on using the changeset viewer.