diff options
Diffstat (limited to 'tests/regressiontests/i18n/commands/compilation.py')
| -rw-r--r-- | tests/regressiontests/i18n/commands/compilation.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/regressiontests/i18n/commands/compilation.py b/tests/regressiontests/i18n/commands/compilation.py index c6ab77941b..2944469110 100644 --- a/tests/regressiontests/i18n/commands/compilation.py +++ b/tests/regressiontests/i18n/commands/compilation.py @@ -4,9 +4,10 @@ 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, six +from django.utils._os import upath from django.utils.six import StringIO -test_dir = os.path.abspath(os.path.dirname(__file__)) +test_dir = os.path.abspath(os.path.dirname(upath(__file__))) class MessageCompilationTests(TestCase): @@ -25,9 +26,9 @@ class PoFileTests(MessageCompilationTests): def test_bom_rejection(self): os.chdir(test_dir) - with six.assertRaisesRegex(self, CommandError, - "file has a BOM \(Byte Order Mark\)"): + with self.assertRaises(CommandError) as cm: call_command('compilemessages', locale=self.LOCALE, stderr=StringIO()) + self.assertIn("file has a BOM (Byte Order Mark)", cm.exception.args[0]) self.assertFalse(os.path.exists(self.MO_FILE)) |
