Files
shelfmark/tests/core/test_request_helpers.py
Alex 4b0d1aef13 Download history refactor pt3 (#706)
- Added canonical per-user visibility of requests and downloads via new
activity view table. Users get fully independent activity and history
views, while admins still see all.
- Replaces janky frontend + backend combination
2026-03-05 19:53:22 +00:00

15 lines
518 B
Python

"""Tests for shared request helper normalization utilities."""
from shelfmark.core.request_helpers import normalize_optional_text
def test_normalize_optional_text_trims_strings():
assert normalize_optional_text(" hello ") == "hello"
def test_normalize_optional_text_returns_none_for_empty_or_non_string_values():
assert normalize_optional_text("") is None
assert normalize_optional_text(None) is None
assert normalize_optional_text(123) is None
assert normalize_optional_text(False) is None