test: add clear-search URL and template tests

Add tests for clear_search_url context and template clear-search button when a search is active.
This commit is contained in:
Miguel Astor
2026-03-25 06:08:00 -04:00
parent b8e7a876a7
commit ab81a0a97d
3 changed files with 39 additions and 0 deletions

View File

@@ -169,6 +169,9 @@ def render_directory(request, path_text, full_path):
"search_action_url": gallery_url(
Path(path_text) if path_text != "" else None, True, search_action_query
),
"clear_search_url": gallery_url(
Path(path_text) if path_text != "" else None, True, None
),
}
# sort_label depends on SORT_LABELS in common; import lazily to avoid circulars