File lstrip.patch of Package python-django-compressor
From 1afd937f6a49b10013c1df71b53d054170efdce4 Mon Sep 17 00:00:00 2001
From: bcail <bcail@crossway.org>
Date: Mon, 3 Jul 2023 17:24:39 +0000
Subject: [PATCH] Add `LazyScriptNamePrefixedUrl.lstrip` to fix tests (#1196)
Needed because of cpython PR
https://github.com/python/cpython/pull/104575
---
compressor/tests/test_offline.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/compressor/tests/test_offline.py b/compressor/tests/test_offline.py
index c208048e..c49d1277 100644
--- a/compressor/tests/test_offline.py
+++ b/compressor/tests/test_offline.py
@@ -58,6 +58,12 @@ def __unicode__(self):
def __hash__(self):
return str.__hash__(str(self))
+ def lstrip(self, *args, **kwargs):
+ """
+ Override ``.lstrip()`` method to make it work with ``{% static %}``.
+ """
+ return str(self).lstrip(*args, **kwargs)
+
def split(self, *args, **kwargs):
"""
Override ``.split()`` method to make it work with ``{% static %}``.