All checks were successful
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m12s
- Enhanced the ACCESS_LAYER_AND_GOVERNANCE_PLAN.md with new specifications for capability documentation and community features. - Added references to new documents detailing capability IDs and club membership features. - Updated MULTI_TENANCY_RBAC_ARCHITECTURE.md to include links to the new specifications. - Marked certain features as deprecated in backend/auth.py, indicating migration paths for club feature access. - Incremented DB_SCHEMA_VERSION to 20260606078 in version.py to reflect recent changes.
28 lines
897 B
Python
28 lines
897 B
Python
"""Unit-Tests für club_features (ohne DB)."""
|
|
from datetime import datetime, timezone
|
|
|
|
from club_features import _calculate_next_reset, _normalize_limit
|
|
|
|
|
|
def test_normalize_limit_none_and_negative():
|
|
assert _normalize_limit(None) is None
|
|
assert _normalize_limit(-1) is None
|
|
assert _normalize_limit(0) == 0
|
|
assert _normalize_limit(50) == 50
|
|
|
|
|
|
def test_calculate_next_reset_never():
|
|
assert _calculate_next_reset("never") is None
|
|
|
|
|
|
def test_calculate_next_reset_monthly_december():
|
|
ref = datetime(2026, 12, 15, 12, 0, tzinfo=timezone.utc)
|
|
nxt = _calculate_next_reset("monthly", now=ref)
|
|
assert nxt == datetime(2027, 1, 1, tzinfo=timezone.utc)
|
|
|
|
|
|
def test_calculate_next_reset_monthly_mid_year():
|
|
ref = datetime(2026, 6, 6, 12, 0, tzinfo=timezone.utc)
|
|
nxt = _calculate_next_reset("monthly", now=ref)
|
|
assert nxt == datetime(2026, 7, 1, tzinfo=timezone.utc)
|