from datetime import UTC, datetime from laborious.utils.time import to_naive def test_to_naive_returns_naive_input_unchanged() -> None: moment = datetime(2024, 1, 1, 12, 30, 45) assert to_naive(moment) == moment assert to_naive(moment).tzinfo is None def test_to_naive_strips_tzinfo_from_aware_input() -> None: moment = datetime(2024, 1, 1, 12, 30, 45, tzinfo=UTC) result = to_naive(moment) assert result.tzinfo is None assert result == datetime(2024, 1, 1, 12, 30, 45)