summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 10:41:42 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 10:41:42 +0200
commit3cb92d3f1f6f976cc5f78e60845a43dc117b8946 (patch)
tree1ba11229023aae36fdda3f93d2df1b6511933f0d /tests
parent213cf68e7995859d149973d9e20aa5fdf0387f37 (diff)
downloadpykolab-3cb92d3f1f6f976cc5f78e60845a43dc117b8946.tar.gz
Catch errors in translation, append UTF-8 if not specified to avoid translation-related tracebacks
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test-015-translate.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unit/test-015-translate.py b/tests/unit/test-015-translate.py
index 6819b80..5eaf5d1 100644
--- a/tests/unit/test-015-translate.py
+++ b/tests/unit/test-015-translate.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import unittest
import gettext
from pykolab import translate
@@ -17,7 +19,12 @@ class TestTranslate(unittest.TestCase):
translate.setUserLanguage('de_DE')
self.assertEqual(_("Folder name"), "Ordnername", "German Translation found")
translate.setUserLanguage('foo_bar')
- self.assertEqual(_("Folder name"), "Folder name", "Unkonwn language falls back to NullTranslations")
+ self.assertEqual(_("Folder name"), "Folder name", "Unknown language falls back to NullTranslations")
+
+ def test_004_unicode(self):
+ from pykolab.translate import _
+ translate.setUserLanguage('de_DE')
+ self.assertEqual(_("recipients: %r"), "Empfänger: %r")
if __name__ == '__main__':
unittest.main()