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

Last change on this file since 9744 was 8057, checked in by Henrik Bettermann, 13 years ago

Adjust copyright header and propset svn:keywords.

  • Property svn:keywords set to Id
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.