diff options
| author | Tim Graham <timograham@gmail.com> | 2017-01-03 19:03:08 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-04 12:50:31 -0500 |
| commit | c85831e4b7b5a7e4249df10327175b7251cb012d (patch) | |
| tree | add2d3d1811666d40316a3b22bd08a58483e68e0 /tests/staticfiles_tests/storage.py | |
| parent | f60d4e704d71b8af3f5ed4651accd33851bdee23 (diff) | |
Fixed #27658 -- Prevented collectstatic from overwriting newer files in remote storages.
Thanks revimi for the initial patch.
Diffstat (limited to 'tests/staticfiles_tests/storage.py')
| -rw-r--r-- | tests/staticfiles_tests/storage.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py index 12eb032d8e..79e6245f59 100644 --- a/tests/staticfiles_tests/storage.py +++ b/tests/staticfiles_tests/storage.py @@ -1,6 +1,6 @@ import errno import os -from datetime import datetime +from datetime import datetime, timedelta from django.conf import settings from django.contrib.staticfiles.storage import CachedStaticFilesStorage @@ -59,6 +59,14 @@ class PathNotImplementedStorage(storage.Storage): raise NotImplementedError +class NeverCopyRemoteStorage(PathNotImplementedStorage): + """ + Return a future modified time for all files so that nothing is collected. + """ + def get_modified_time(self, name): + return datetime.now() + timedelta(days=30) + + class QueryStringStorage(storage.Storage): def url(self, path): return path + '?a=b&c=d' |
