Fix broken expired_session fixture, add test for future

This commit is contained in:
2024-11-10 13:00:37 -06:00
parent d8659c903f
commit 4d6c46a309

View File

@@ -25,10 +25,16 @@ def session(user):
@pytest.fixture
def expired_session(session):
session.created_at = utc_now() - timedelta(hours=2) # Required to bypass the constraint
session.expiry = utc_now() - timedelta(hours=1)
session.save()
return session
def test_expired_session_fixture(expired_session):
assert expired_session.is_expired() is True
def test_session_create(session):
assert Session.get_or_none(Session.token == session.token) is not None