diff options
author | Jannis Leidel <jannis@leidel.info> | 2014-02-09 14:48:11 +0000 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2014-02-09 14:48:11 +0000 |
commit | f90be002d9d3c10b87c74741986e2cbf9f2b858e (patch) | |
tree | 4ed6b418bdfb0a3d52661395e4440a93cc25f1b1 /tests | |
parent | 6a9ed7d403a5f90a7c7354097aae99b74e8ce215 (diff) | |
download | django-f90be002d9d3c10b87c74741986e2cbf9f2b858e.tar.gz |
Fixed #20780 -- Get rid of stale symlinks when using collectstatic.
Thanks to John Giannelos for the initial patch.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/staticfiles_tests/tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py index 9261503726..95852acd09 100644 --- a/tests/staticfiles_tests/tests.py +++ b/tests/staticfiles_tests/tests.py @@ -694,6 +694,15 @@ class TestCollectionLinks(CollectionTestCase, TestDefaults): """ self.assertTrue(os.path.islink(os.path.join(settings.STATIC_ROOT, 'test.txt'))) + def test_broken_symlink(self): + """ + Test broken symlink gets deleted. + """ + path = os.path.join(settings.STATIC_ROOT, 'test.txt') + os.unlink(path) + self.run_collectstatic() + self.assertTrue(os.path.islink(path)) + class TestServeStatic(StaticFilesTestCase): """ |