diff options
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/i18n/commands/compilation.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/regressiontests/i18n/commands/compilation.py b/tests/regressiontests/i18n/commands/compilation.py index d88e1feef6..b6119cf43d 100644 --- a/tests/regressiontests/i18n/commands/compilation.py +++ b/tests/regressiontests/i18n/commands/compilation.py @@ -1,10 +1,10 @@ import os -from io import BytesIO from django.core.management import call_command, CommandError from django.test import TestCase from django.test.utils import override_settings from django.utils import translation +from django.utils.six import StringIO test_dir = os.path.abspath(os.path.dirname(__file__)) @@ -26,7 +26,7 @@ class PoFileTests(MessageCompilationTests): os.chdir(test_dir) with self.assertRaisesRegexp(CommandError, "file has a BOM \(Byte Order Mark\)"): - call_command('compilemessages', locale=self.LOCALE, stderr=BytesIO()) + call_command('compilemessages', locale=self.LOCALE, stderr=StringIO()) self.assertFalse(os.path.exists(self.MO_FILE)) @@ -42,7 +42,7 @@ class PoFileContentsTests(MessageCompilationTests): def test_percent_symbol_in_po_file(self): os.chdir(test_dir) - call_command('compilemessages', locale=self.LOCALE, stderr=BytesIO()) + call_command('compilemessages', locale=self.LOCALE, stderr=StringIO()) self.assertTrue(os.path.exists(self.MO_FILE)) @@ -57,7 +57,7 @@ class PercentRenderingTests(MessageCompilationTests): def test_percent_symbol_escaping(self): from django.template import Template, Context os.chdir(test_dir) - call_command('compilemessages', locale=self.LOCALE, stderr=BytesIO()) + call_command('compilemessages', locale=self.LOCALE, stderr=StringIO()) with translation.override(self.LOCALE): t = Template('{% load i18n %}{% trans "Looks like a str fmt spec %% o but shouldn\'t be interpreted as such" %}') rendered = t.render(Context({})) |
