Ignore:
Timestamp:
24 Feb 2017, 09:24:09 (8 years ago)
Author:
Henrik Bettermann
Message:

Replace maxCreditsExceeded by warnCreditsOOR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r14544 r14585  
    138138        return
    139139
    140     def test_maxCredits(self):
    141         dummy = object()
    142         utils = getUtility(IStudentsUtils)
    143         self.assertEqual(utils.maxCredits(dummy), 48)
     140    def test_maxCreditsExceeded(self):
     141        students_utils = getUtility(IStudentsUtils)
     142        studylevel = grok.Container()
     143        studylevel.total_credits = 30
     144        course = grok.Model()
     145        course.credits = 18
     146        warning = students_utils.warnCreditsOOR(studylevel, course)
     147        self.assertEqual(warning, None)
     148        course.credits = 19
     149        warning = students_utils.warnCreditsOOR(studylevel, course)
     150        self.assertEqual(warning, 'Maximum credits exceeded.')
    144151        return
    145152
Note: See TracChangeset for help on using the changeset viewer.