Changeset 9183 for main/waeup.kofa/trunk


Ignore:
Timestamp:
14 Sep 2012, 05:43:25 (12 years ago)
Author:
Henrik Bettermann
Message:

Do it right and add test.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/student.py

    r9182 r9183  
    137137
    138138    @property
     139    def current_verdict(self):
     140        level = getattr(
     141            self.get('studycourse', None), 'current_verdict', None)
     142        return level
     143
     144    @property
    139145    def current_mode(self):
    140146        certificate = getattr(
     
    142148        if certificate is not None:
    143149            return certificate.study_mode
    144         return None
    145 
    146     @property
    147     def current_verdict(self):
    148         certificate = getattr(
    149             self.get('studycourse', None), 'certificate', None)
    150         if certificate is not None:
    151             return certificate.current_verdict
    152150        return None
    153151
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9178 r9183  
    403403
    404404    layer = FunctionalLayer
     405
     406    def test_student_properties(self):
     407        self.student['studycourse'].current_level = 100
     408        self.assertEqual(self.student.current_level, 100)
     409        self.student['studycourse'].current_session = 2011
     410        self.assertEqual(self.student.current_session, 2011)
     411        self.student['studycourse'].current_verdict = 'A'
     412        self.assertEqual(self.student.current_verdict, 'A')
     413        return
    405414
    406415    def test_basic_auth(self):
Note: See TracChangeset for help on using the changeset viewer.