Changeset 14586 for main/waeup.fceokene/trunk/src
- Timestamp:
- 24 Feb 2017, 09:25:22 (8 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py
r14566 r14586 37 37 course = grok.Model() 38 38 course.credits = 18 39 max_credits = students_utils.maxCreditsExceeded(studylevel, course)40 self.assertEqual( max_credits, 0)39 warning = students_utils.warnCreditsOOR(studylevel, course) 40 self.assertEqual(warning, None) 41 41 course.credits = 19 42 max_credits = students_utils.maxCreditsExceeded(studylevel, course)43 self.assertEqual( max_credits, 58)42 warning = students_utils.warnCreditsOOR(studylevel, course) 43 self.assertEqual(warning, 'Maximum credits exceeded.') 44 44 return 45 45 -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r14566 r14586 361 361 return d 362 362 363 def maxCredits(self, studylevel): 364 """Return maximum credits. 365 366 """ 367 return 58 363 def warnCreditsOOR(self, studylevel, course=None): 364 """Return message if credits are out of range. In the base 365 package only maximum credits is set. 366 """ 367 if course and studylevel.total_credits + course.credits > 58: 368 return _('Maximum credits exceeded.') 369 elif studylevel.total_credits > 58: 370 return _('Maximum credits exceeded.') 371 return 368 372 369 373 def getPDFCreator(self, context):
Note: See TracChangeset for help on using the changeset viewer.