mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 20:11:30 +00:00
11 lines
310 B
Python
11 lines
310 B
Python
|
import pytest
|
||
|
from datetime import datetime, timedelta
|
||
|
|
||
|
from selfprivacy_api.models.tokens.recovery_key import RecoveryKey
|
||
|
|
||
|
|
||
|
def test_recovery_key_expired():
|
||
|
expiration = datetime.now() - timedelta(minutes=5)
|
||
|
key = RecoveryKey.generate(expiration=expiration, uses_left=2)
|
||
|
assert not key.is_valid()
|