Ignore:
Timestamp:
22 Apr 2014, 05:43:05 (11 years ago)
Author:
Henrik Bettermann
Message:

Add StudentsUtilsTests? class for pure utility method tests.

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

Legend:

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

    r11568 r11588  
    30273027            'Your personal data record is outdated.' in self.browser.contents)
    30283028
    3029     def test_setReturningData(self):
    3030         utils = getUtility(IStudentsUtils)
    3031         self.student['studycourse'].current_level = 600
    3032         utils.setReturningData(self.student)
    3033         # The new level exceeds the certificates end_level.
    3034         # In this case current_level remains unchanged and no error is raised.
    3035         self.assertEqual(self.student['studycourse'].current_level, 600)
    3036 
    30373029    def test_request_transcript(self):
    30383030        IWorkflowState(self.student).setState('graduated')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_utils.py

    r9911 r11588  
    11# -*- coding: utf-8 -*-
    22import unittest
     3from zope.component import getUtility
     4from waeup.kofa.students.interfaces import IStudentsUtils
    35from waeup.kofa.students.utils import formatted_text
     6from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    47
    58class FormatterTests(unittest.TestCase):
     
    2427            result5, u'<font color="red">sample</font>')
    2528        return
     29
     30class StudentsUtilsTests(StudentsFullSetup):
     31
     32    def test_setReturningData(self):
     33        utils = getUtility(IStudentsUtils)
     34        self.student['studycourse'].current_level = 600
     35        utils.setReturningData(self.student)
     36        # The new level exceeds the certificates end_level.
     37        # In this case current_level remains unchanged and no error is raised.
     38        self.assertEqual(self.student['studycourse'].current_level, 600)
Note: See TracChangeset for help on using the changeset viewer.