Loading tests/i18n/commands/extraction.py +11 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from __future__ import unicode_literals import os import re import shutil from unittest import SkipTest import warnings from django.core import management Loading Loading @@ -314,11 +315,20 @@ class SymlinkExtractorTests(ExtractorTests): os.chdir(self._cwd) def test_symlink(self): # On Python < 3.2 os.symlink() exists only on Unix if hasattr(os, 'symlink'): if os.path.exists(self.symlinked_dir): self.assertTrue(os.path.islink(self.symlinked_dir)) else: # On Python >= 3.2) os.symlink() exists always but then can # fail at runtime when user hasn't the needed permissions on # WIndows versions that support symbolink links (>= 6/Vista). # See Python issue 9333 (http://bugs.python.org/issue9333). # Skip the test in that case try: os.symlink(os.path.join(self.test_dir, 'templates'), self.symlinked_dir) except (OSError, NotImplementedError): raise SkipTest("os.symlink() is available on this OS but can't be used by this user.") os.chdir(self.test_dir) management.call_command('makemessages', locale=LOCALE, verbosity=0, symlinks=True) self.assertTrue(os.path.exists(self.PO_FILE)) Loading Loading
tests/i18n/commands/extraction.py +11 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from __future__ import unicode_literals import os import re import shutil from unittest import SkipTest import warnings from django.core import management Loading Loading @@ -314,11 +315,20 @@ class SymlinkExtractorTests(ExtractorTests): os.chdir(self._cwd) def test_symlink(self): # On Python < 3.2 os.symlink() exists only on Unix if hasattr(os, 'symlink'): if os.path.exists(self.symlinked_dir): self.assertTrue(os.path.islink(self.symlinked_dir)) else: # On Python >= 3.2) os.symlink() exists always but then can # fail at runtime when user hasn't the needed permissions on # WIndows versions that support symbolink links (>= 6/Vista). # See Python issue 9333 (http://bugs.python.org/issue9333). # Skip the test in that case try: os.symlink(os.path.join(self.test_dir, 'templates'), self.symlinked_dir) except (OSError, NotImplementedError): raise SkipTest("os.symlink() is available on this OS but can't be used by this user.") os.chdir(self.test_dir) management.call_command('makemessages', locale=LOCALE, verbosity=0, symlinks=True) self.assertTrue(os.path.exists(self.PO_FILE)) Loading