source: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_utils.py @ 7952

Last change on this file since 7952 was 7811, checked in by uli, 13 years ago

Rename all non-locales stuff from sirp to kofa.

File size: 1022 bytes
Line 
1# -*- coding: utf-8 -*-
2import unittest
3from waeup.kofa.students.utils import formatted_text
4
5class FormatterTests(unittest.TestCase):
6
7    def test_formatted_text(self):
8        # we can format strings, unicode and things convertable to unicode.
9        result1 = formatted_text('sample')
10        result2 = formatted_text('ümlaut')
11        result3 = formatted_text(3)
12        result4 = formatted_text(u'unicöde')
13        result5 = formatted_text(u'sample', color='red', size=12)
14        self.assertTrue(isinstance(result1, unicode))
15        self.assertEqual(
16            result1, u'<font color="black" size="10">sample</font>')
17        self.assertEqual(
18            result2, u'<font color="black" size="10">ümlaut</font>')
19        self.assertEqual(
20            result3, u'<font color="black" size="10">3</font>')
21        self.assertEqual(
22            result4, u'<font color="black" size="10">unicöde</font>')
23        self.assertEqual(
24            result5, u'<font color="red" size="12">sample</font>')
25        return
Note: See TracBrowser for help on using the repository browser.