setting, session and profile
This commit is contained in:
parent
48eea5d201
commit
4a563f4f34
31 changed files with 1797 additions and 159 deletions
21
backend/tests/test_session_policy.py
Normal file
21
backend/tests/test_session_policy.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import pytest
|
||||
|
||||
from app.services.session_policy import (
|
||||
ALLOWED_SESSION_TIMEOUT_SET,
|
||||
DEFAULT_SESSION_TIMEOUT_MINUTES,
|
||||
validate_session_timeout_minutes,
|
||||
)
|
||||
|
||||
|
||||
def test_default_session_is_one_week():
|
||||
assert DEFAULT_SESSION_TIMEOUT_MINUTES == 10_080
|
||||
|
||||
|
||||
def test_allowed_session_timeouts_cover_one_hour_to_ninety_days():
|
||||
assert min(ALLOWED_SESSION_TIMEOUT_SET) == 60
|
||||
assert max(ALLOWED_SESSION_TIMEOUT_SET) == 129_600
|
||||
|
||||
|
||||
def test_validate_session_timeout_rejects_unknown_values():
|
||||
with pytest.raises(ValueError):
|
||||
validate_session_timeout_minutes(90)
|
||||
Loading…
Add table
Add a link
Reference in a new issue