From: Oleg Broytman Date: Sun, 2 Oct 2016 19:43:20 +0000 (+0300) Subject: Add test_translations X-Git-Tag: 0.0.15~19 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=0637a5e2ea44edb768f70525695a89da3ecca8e2 Add test_translations --- diff --git a/tests/test_translations.py b/tests/test_translations.py new file mode 100644 index 0000000..313d6d6 --- /dev/null +++ b/tests/test_translations.py @@ -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'Файл'