- Timestamp:
- 22 Dec 2016, 20:22:28 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/studycourse.py
r13528 r14362 48 48 return self.is_postgrad 49 49 50 def _display_gpa(self, gpa): 51 return int(100 * gpa) / 100.0 52 50 53 CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse) 51 54 -
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r14357 r14362 60 60 return total 61 61 62 def _display_gpa(self, gpa): 63 return int(100 * gpa) / 100.0 64 62 65 @property 63 66 def gpa_params(self): … … 72 75 credits_weighted += ticket.credits * ticket.weight 73 76 if credits_counted: 74 level_gpa = round(credits_weighted/credits_counted, 3)77 level_gpa = self._display_gpa(credits_weighted/credits_counted) 75 78 # Override level_gpa if value has been imported 76 79 imported_gpa = getattr(self, 'imported_gpa', None) -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r14355 r14362 116 116 # sgpa = 82 / 23 117 117 self.assertEqual( 118 self.student['studycourse']['100'].gpa_params[0], 3.56 5)118 self.student['studycourse']['100'].gpa_params[0], 3.56) 119 119 # imported gpa values override calculated values 120 120 studylevel.imported_gpa = 4.3 … … 388 388 self.assertEqual(self.browser.headers['Content-Type'], 389 389 'text/csv; charset=UTF-8') 390 self.assertEqual(self.browser.contents, 'matric_number,student_id, '391 'level,code,level_session,ca,score\r\n234,E1000000, '390 self.assertEqual(self.browser.contents, 'matric_number,student_id,display_fullname,' 391 'level,code,level_session,ca,score\r\n234,E1000000,"TESTER, Anna",' 392 392 '100,COURSE1,2003,,55\r\n') 393 393 self.browser.open(self.edit_prev_scores_url) … … 453 453 self.assertEqual(td[0][1]['level'].level_session, 2006) 454 454 self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE') 455 self.assertEqual(td[1], 3.5 7)455 self.assertEqual(td[1], 3.56) 456 456 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 457 457 self.browser.open(self.student_path + '/studycourse/transcript')
Note: See TracChangeset for help on using the changeset viewer.