summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2014-02-09 12:37:14 +0000
committerJannis Leidel <jannis@leidel.info>2014-02-09 12:39:20 +0000
commit5cc0555603167c7532b7b714e2672687da8f106e (patch)
tree0bf2b356d89aca059737134d9beaf1b70e460ed7 /tests/staticfiles_tests
parent9c4ad454d18816d418b0bd31be91fae16c795f15 (diff)
Fixed #21482 -- Uplifted restriction of collectstatic using symlink option in Windows NT 6.
Original patch by Vajrasky Kok. Reviewed by Florian Apolloner, Aymeric Augustin.
Diffstat (limited to 'tests/staticfiles_tests')
-rw-r--r--tests/staticfiles_tests/tests.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py
index 1d3daff11e..c67a4672b4 100644
--- a/tests/staticfiles_tests/tests.py
+++ b/tests/staticfiles_tests/tests.py
@@ -17,7 +17,7 @@ from django.core.management import call_command
from django.test import TestCase, override_settings
from django.utils.encoding import force_text
from django.utils.functional import empty
-from django.utils._os import rmtree_errorhandler, upath
+from django.utils._os import rmtree_errorhandler, upath, symlinks_supported
from django.utils import six
from django.contrib.staticfiles import finders, storage
@@ -645,24 +645,25 @@ class TestCollectionSimpleCachedStorage(BaseCollectionTestCase,
self.assertNotIn(b"cached/other.css", content)
self.assertIn(b"other.deploy12345.css", content)
-if sys.platform != 'win32':
- class TestCollectionLinks(CollectionTestCase, TestDefaults):
- """
- Test ``--link`` option for ``collectstatic`` management command.
+@unittest.skipUnless(symlinks_supported(),
+ "Must be able to symlink to run this test.")
+class TestCollectionLinks(CollectionTestCase, TestDefaults):
+ """
+ Test ``--link`` option for ``collectstatic`` management command.
- Note that by inheriting ``TestDefaults`` we repeat all
- the standard file resolving tests here, to make sure using
- ``--link`` does not change the file-selection semantics.
- """
- def run_collectstatic(self):
- super(TestCollectionLinks, self).run_collectstatic(link=True)
+ Note that by inheriting ``TestDefaults`` we repeat all
+ the standard file resolving tests here, to make sure using
+ ``--link`` does not change the file-selection semantics.
+ """
+ def run_collectstatic(self):
+ super(TestCollectionLinks, self).run_collectstatic(link=True)
- def test_links_created(self):
- """
- With ``--link``, symbolic links are created.
- """
- self.assertTrue(os.path.islink(os.path.join(settings.STATIC_ROOT, 'test.txt')))
+ def test_links_created(self):
+ """
+ With ``--link``, symbolic links are created.
+ """
+ self.assertTrue(os.path.islink(os.path.join(settings.STATIC_ROOT, 'test.txt')))
class TestServeStatic(StaticFilesTestCase):