1
0
mirror of https://github.com/django/django.git synced 2025-10-30 17:16:10 +00:00

[1.5.x] Fixed #19357 -- Allow non-ASCII chars in filesystem paths

Thanks kujiu for the report and Aymeric Augustin for the review.
Backport of c91667338 from master.
This commit is contained in:
Claude Paroz
2012-12-08 11:13:52 +01:00
parent a0578a1a1c
commit 4214a22e06
56 changed files with 228 additions and 147 deletions

View File

@@ -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))