Last change
on this file since 17931 was
9911,
checked in by Henrik Bettermann, 12 years ago
|
Add colons.
The font size is now set by ENTRY1_STYLE.
|
-
Property svn:keywords set to
Id
|
File size:
963 bytes
|
Line | |
---|
1 | # -*- coding: utf-8 -*- |
---|
2 | import unittest |
---|
3 | from waeup.kofa.students.utils import formatted_text |
---|
4 | |
---|
5 | class 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') |
---|
14 | self.assertTrue(isinstance(result1, unicode)) |
---|
15 | self.assertEqual( |
---|
16 | result1, u'<font color="black">sample</font>') |
---|
17 | self.assertEqual( |
---|
18 | result2, u'<font color="black">ümlaut</font>') |
---|
19 | self.assertEqual( |
---|
20 | result3, u'<font color="black">3</font>') |
---|
21 | self.assertEqual( |
---|
22 | result4, u'<font color="black">unicöde</font>') |
---|
23 | self.assertEqual( |
---|
24 | result5, u'<font color="red">sample</font>') |
---|
25 | return |
---|
Note: See
TracBrowser for help on using the repository browser.