diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-02-27 21:30:07 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-03-30 14:34:41 +0200 |
| commit | edcecaf0dea718a8fb216df478df0d151a9ba04d (patch) | |
| tree | c01c92028af6141d4da58ec49ddd12441077d8a0 /tests/staticfiles_tests/storage.py | |
| parent | 940b7fd5cbcd743658f741d37b3d7b1766ed1f17 (diff) | |
Fixed #19670 -- Applied CachedFilesMixin patterns to specific extensions
Thanks Simon Meers for the initial patch, and Tim Graham for the review.
Diffstat (limited to 'tests/staticfiles_tests/storage.py')
| -rw-r--r-- | tests/staticfiles_tests/storage.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py index 06caebfcd2..8c474591f3 100644 --- a/tests/staticfiles_tests/storage.py +++ b/tests/staticfiles_tests/storage.py @@ -63,3 +63,17 @@ class SimpleCachedStaticFilesStorage(CachedStaticFilesStorage): def file_hash(self, name, content=None): return 'deploy12345' + + +class ExtraPatternsCachedStaticFilesStorage(CachedStaticFilesStorage): + """ + A storage class to test pattern substitutions with more than one pattern + entry. The added pattern rewrites strings like "url(...)" to JS_URL("..."). + """ + patterns = tuple(CachedStaticFilesStorage.patterns) + ( + ( + "*.js", ( + (r"""(url\(['"]{0,1}\s*(.*?)["']{0,1}\))""", 'JS_URL("%s")'), + ), + ), + ) |
