]> git.phdru.name Git - m_librarian.git/commitdiff
Add test_translations
authorOleg Broytman <phd@phdru.name>
Sun, 2 Oct 2016 19:43:20 +0000 (22:43 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 2 Oct 2016 19:43:20 +0000 (22:43 +0300)
tests/test_translations.py [new file with mode: 0644]

diff --git a/tests/test_translations.py b/tests/test_translations.py
new file mode 100644 (file)
index 0000000..313d6d6
--- /dev/null
@@ -0,0 +1,17 @@
+# coding: utf-8
+
+import os
+save_locale = os.environ.get('LC_CTYPE')
+os.environ['LC_CTYPE'] = 'ru_RU'
+
+from m_librarian.translations import translations  # noqa
+
+if save_locale:
+    os.environ['LC_CTYPE'] = save_locale
+
+_ = getattr(translations, 'ugettext', None) or translations.gettext
+
+
+def test_translations():
+    assert _('xxx') == u'xxx'
+    assert _('File') == u'Файл'