summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests/storage.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-08 12:09:55 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-08 12:15:38 +0100
commit6a682b38e75d4c975b4c4493565a59f1bc14397c (patch)
tree0bd9cda550bea26238656d9f120d769e8b41bb9e /tests/staticfiles_tests/storage.py
parente73ce08888e6f34d3f050377cfd2fbb733be94a9 (diff)
[4.0.x] Refs #33476 -- Reformatted code with Black.
Backport of 9c19aff7c7561e3a82978a272ecdaad40dda5c00 from main.
Diffstat (limited to 'tests/staticfiles_tests/storage.py')
-rw-r--r--tests/staticfiles_tests/storage.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py
index 6a319f934d..1bb4e37485 100644
--- a/tests/staticfiles_tests/storage.py
+++ b/tests/staticfiles_tests/storage.py
@@ -12,8 +12,9 @@ class DummyStorage(storage.Storage):
A storage class that implements get_modified_time() but raises
NotImplementedError for path().
"""
+
def _save(self, name, content):
- return 'dummy'
+ return "dummy"
def delete(self, name):
pass
@@ -26,9 +27,8 @@ class DummyStorage(storage.Storage):
class PathNotImplementedStorage(storage.Storage):
-
def _save(self, name, content):
- return 'dummy'
+ return "dummy"
def _path(self, name):
return os.path.join(settings.STATIC_ROOT, name)
@@ -62,19 +62,19 @@ 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'
+ return path + "?a=b&c=d"
class SimpleStorage(ManifestStaticFilesStorage):
-
def file_hash(self, name, content=None):
- return 'deploy12345'
+ return "deploy12345"
class ExtraPatternsStorage(ManifestStaticFilesStorage):
@@ -82,9 +82,11 @@ class ExtraPatternsStorage(ManifestStaticFilesStorage):
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(ManifestStaticFilesStorage.patterns) + (
(
- "*.js", (
+ "*.js",
+ (
(
r"""(?P<matched>url\(['"]{0,1}\s*(?P<url>.*?)["']{0,1}\))""",
'JS_URL("%(url)s")',