mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-06 15:15:34 -06:00
Fix broken expired_session fixture, add test for future
This commit is contained in:
@@ -25,10 +25,16 @@ def session(user):
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def expired_session(session):
|
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.expiry = utc_now() - timedelta(hours=1)
|
||||||
|
session.save()
|
||||||
return session
|
return session
|
||||||
|
|
||||||
|
|
||||||
|
def test_expired_session_fixture(expired_session):
|
||||||
|
assert expired_session.is_expired() is True
|
||||||
|
|
||||||
|
|
||||||
def test_session_create(session):
|
def test_session_create(session):
|
||||||
assert Session.get_or_none(Session.token == session.token) is not None
|
assert Session.get_or_none(Session.token == session.token) is not None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user