summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2015-12-13 19:15:56 +0500
committerClaude Paroz <claude@2xlibre.net>2015-12-13 16:33:31 +0100
commit5005b527cb9c7a2bfc76daa7f717bf7e3064e9ce (patch)
tree0062b255e7d9fc174f4949860a515018d52135a4
parented20dd2e85a0bbd45085809417c29e92ced5e618 (diff)
Fixed #25925 -- Forced LANG=C for test_msgfmt_error_including_non_ascii.
-rw-r--r--tests/i18n/test_compilation.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/i18n/test_compilation.py b/tests/i18n/test_compilation.py
index c2bd292b1d..6410b8d74a 100644
--- a/tests/i18n/test_compilation.py
+++ b/tests/i18n/test_compilation.py
@@ -6,6 +6,7 @@ import os
import shutil
import stat
import unittest
+from subprocess import Popen
from django.core.management import (
CommandError, call_command, execute_from_command_line,
@@ -13,7 +14,7 @@ from django.core.management import (
from django.core.management.commands.makemessages import \
Command as MakeMessagesCommand
from django.core.management.utils import find_command
-from django.test import SimpleTestCase, override_settings
+from django.test import SimpleTestCase, mock, override_settings
from django.test.utils import captured_stderr, captured_stdout
from django.utils import six, translation
from django.utils._os import upath
@@ -164,6 +165,10 @@ class CompilationErrorHandling(MessageCompilationTests):
with self.assertRaises(CommandError):
call_command('compilemessages', locale=['ja'], verbosity=0)
+ # We will check the output of msgfmt, so we need to make sure its output
+ # is unaffected by the current locale.
+ @mock.patch('django.core.management.utils.Popen',
+ lambda *args, **kwargs: Popen(*args, env={'LANG': 'C'}, **kwargs))
def test_msgfmt_error_including_non_ascii(self):
# po file contains invalid msgstr content (triggers non-ascii error content).
mo_file = 'locale/ko/LC_MESSAGES/django.mo'