refactor: usage notes + tests for safer_staticfiles (#538)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Juro Oravec 2024-07-08 07:25:03 +02:00 committed by GitHub
parent 3dadba6636
commit 23d91218bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 226 additions and 4 deletions

View file

@ -770,7 +770,14 @@ class MediaRelativePathTests(BaseTestCase):
# Fix the paths, since the "components" dir is nested
with autodiscover_with_cleanup(map_import_paths=lambda p: f"tests.{p}"):
component.registry.unregister("relative_file_pathobj_component")
# Make sure that only relevant components are registered:
comps_to_remove = [
comp_name
for comp_name in component.registry.all()
if comp_name not in ["relative_file_component", "parent_component", "variable_display"]
]
for comp_name in comps_to_remove:
component.registry.unregister(comp_name)
template_str: types.django_html = """
{% load component_tags %}{% component_dependencies %}