Changeset 14617 for main/waeup.fceokene/trunk/src
- Timestamp:
- 9 Mar 2017, 16:33:34 (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
r14591 r14617 31 31 return 32 32 33 def test_warnCreditsOOR(self):33 def disabled_test_warnCreditsOOR_semester_exceeded(self): 34 34 students_utils = getUtility(IStudentsUtils) 35 35 studylevel = grok.Container() … … 54 54 return 55 55 56 def test_warnCreditsOOR(self): 57 students_utils = getUtility(IStudentsUtils) 58 studylevel = grok.Container() 59 studylevel.total_credits = 45 60 course = grok.Model() 61 course.credits = 7 62 warning = students_utils.warnCreditsOOR(studylevel, course) 63 self.assertEqual(warning, None) 64 course.credits = 8 65 warning = students_utils.warnCreditsOOR(studylevel, course) 66 self.assertEqual(warning, 'Maximum credits exceeded.') 67 studylevel.total_credits_s1 = 17 68 warning = students_utils.warnCreditsOOR(studylevel) 69 self.assertEqual(warning, 'Minimum credits in 1st semester not reached.') 70 return 71 56 72 def test_set_payment_details(self): 57 73 self.certificate.end_level = 300 -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r14591 r14617 280 280 # Add session and level specific penalty fee. 281 281 if category == 'schoolfee' and student.current_mode in ( 282 'ug_ft', 'de_ft') :282 'ug_ft', 'de_ft') and student.state != CLEARED: 283 283 amount += academic_session.penalty_ug_ft 284 284 elif category == 'schoolfee' and student.current_mode in ( … … 361 361 return d 362 362 363 #def warnCreditsOOR(self, studylevel, course=None): 364 # """Return message if credits are out of range. 365 # """ 366 # # adding a course ticket 367 # if course: 368 # if course.semester == 1: 369 # if studylevel.total_credits_s1 + course.credits > 24: 370 # return _('Maximum credits in 1st semester exceeded.') 371 # if course.semester == 2: 372 # if studylevel.total_credits_s2 + course.credits > 24: 373 # return _('Maximum credits in 2nd semester exceeded.') 374 # # registering course list 375 # else: 376 # if studylevel.total_credits_s1 > 24: 377 # return _('Maximum credits in 1st semester exceeded.') 378 # if studylevel.total_credits_s1 < 18: 379 # return _('Minimum credits in 1st semester not reached.') 380 # if studylevel.total_credits_s2 > 24: 381 # return _('Maximum credits in 2nd semester exceeded.') 382 # if studylevel.total_credits_s2 < 18: 383 # return _('Minimum credits in 2nd semester not reached.') 384 # return 385 363 386 def warnCreditsOOR(self, studylevel, course=None): 364 387 """Return message if credits are out of range. … … 366 389 # adding a course ticket 367 390 if course: 368 if course.semester == 1: 369 if studylevel.total_credits_s1 + course.credits > 24: 370 return _('Maximum credits in 1st semester exceeded.') 371 if course.semester == 2: 372 if studylevel.total_credits_s2 + course.credits > 24: 373 return _('Maximum credits in 2nd semester exceeded.') 391 if studylevel.total_credits + course.credits > 52: 392 return _('Maximum credits exceeded.') 374 393 # registering course list 375 394 else: 376 if studylevel.total_credits _s1 > 24:377 return _('Maximum credits in 1st semesterexceeded.')395 if studylevel.total_credits > 52: 396 return _('Maximum credits exceeded.') 378 397 if studylevel.total_credits_s1 < 18: 379 398 return _('Minimum credits in 1st semester not reached.') 380 if studylevel.total_credits_s2 > 24:381 return _('Maximum credits in 2nd semester exceeded.')382 399 if studylevel.total_credits_s2 < 18: 383 400 return _('Minimum credits in 2nd semester not reached.')
Note: See TracChangeset for help on using the changeset viewer.