-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: use time-machine instead of freezegun
- Loading branch information
Showing
3 changed files
with
73 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
import pytest | ||
import requests | ||
from freezegun import freeze_time | ||
from time_machine import travel | ||
|
||
from b3desk.models import db | ||
from b3desk.models.users import NoUserFound | ||
|
@@ -36,10 +36,10 @@ def test_update_last_connection_if_more_than_24h(client_app): | |
"preferred_username": "alice", | ||
"email": "[email protected]", | ||
} | ||
with freeze_time("2021-08-10"): | ||
with travel("2021-08-10 12:00:00"): | ||
get_or_create_user(user_info) | ||
|
||
with freeze_time("2021-08-11"): | ||
with travel("2021-08-11 12:00:00"): | ||
user = db.session.get(User, 1) | ||
assert user.last_connection_utc_datetime.date() == date(2021, 8, 10) | ||
|
||
|