- Timestamp:
- 24 Feb 2017, 09:29:33 (8 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r14421 r14588 763 763 self.app['faculties']['fac1']['dep1'].courses['COURSE1'].credits = 51 764 764 self.browser.getControl("Add course ticket").click() 765 self.assertMatches('... Total credits exceed 50...',765 self.assertMatches('...Maximum credits exceeded...', 766 766 self.browser.contents) 767 767 # Final year students can't add ticket with 52 credits ... … … 769 769 self.student['studycourse'].certificate.end_level = 700 770 770 self.browser.getControl("Add course ticket").click() 771 self.assertMatches('... Total credits exceed 51...',771 self.assertMatches('...Maximum credits exceeded...', 772 772 self.browser.contents) 773 773 # ... but with 51 credits … … 780 780 self.student['studycourse'].certificate.end_level = 800 781 781 self.browser.getControl("Register course list").click() 782 self.assertMatches('...Maximum credits of 50exceeded...',782 self.assertMatches('...Maximum credits exceeded...', 783 783 self.browser.contents) 784 784 # ... but final year students can -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r14358 r14588 370 370 return None, payment 371 371 372 def maxCredits(self, studylevel): 373 """Return maximum credits. 374 375 """ 372 def warnCreditsOOR(self, studylevel, course=None): 376 373 studycourse = studylevel.__parent__ 377 374 certificate = getattr(studycourse,'certificate', None) 378 375 current_level = studycourse.current_level 379 376 if None in (current_level, certificate): 380 return 0377 return 381 378 end_level = certificate.end_level 382 379 if current_level >= end_level: 383 return 51 384 return 50 380 limit = 51 381 else: 382 limit = 50 383 if course and studylevel.total_credits + course.credits > limit: 384 return _('Maximum credits exceeded.') 385 elif studylevel.total_credits > limit: 386 return _('Maximum credits exceeded.') 387 return 385 388 386 389 def clearance_disabled_message(self, student):
Note: See TracChangeset for help on using the changeset viewer.