Changeset 9133 for main/waeup.kofa/trunk/src
- Timestamp:
- 31 Aug 2012, 14:54:18 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r7811 r9133 21 21 22 22 23 class FakeStudyCourse( object):23 class FakeStudyCourse(dict): 24 24 25 def __init__( self):25 def __init__(object): 26 26 cert = Certificate(code="CERT1") 27 27 cert.start_level = 100 28 28 cert.end_level = 500 29 29 self.certificate = cert 30 31 def get(self, attr, default=None): 32 try: 33 return self.__getattribute__(attr) 34 except AttributeError: 35 return default 30 36 31 37 class VocabularyTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py
r8940 r9133 36 36 nats_vocab = SimpleKofaVocabulary(*COUNTRIES) 37 37 38 def study_levels( studycourse):39 if studycourse.certificateis not None:40 start_level = int( studycourse.certificate.start_level)41 end_level = int( studycourse.certificate.end_level)38 def study_levels(context): 39 if context.get('certificate', None) is not None: 40 start_level = int(context.certificate.start_level) 41 end_level = int(context.certificate.end_level) 42 42 if start_level == 999 or end_level == 999: 43 43 levels = [999] … … 69 69 70 70 def getTitle(self, context, value): 71 if context. certificateis not None:71 if context.get('certificate', None) is not None: 72 72 start_level = int(context.certificate.start_level) 73 73 end_level = int(context.certificate.end_level) … … 80 80 return _('Error: wrong level id ${value}', 81 81 mapping={'value': value}) 82 if value == 999: 82 83 return course_levels.by_value[999].title 83 84 if value < start_level or value > end_level + 120:
Note: See TracChangeset for help on using the changeset viewer.