Skip to content

Commit

Permalink
replace utcnow
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Oct 26, 2023
1 parent 0f4167f commit eac134f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

import pytest

Expand Down Expand Up @@ -259,7 +259,8 @@ def test_create_history_entry():
assert isinstance(entry, HistoryEntry)
assert entry["description"] == "Once upon a time..."
assert entry.get("software") is None
assert (datetime.utcnow() - entry["time"]) < timedelta(seconds=10)
dt = datetime.now(timezone.utc).replace(tzinfo=None)
assert (dt - entry["time"]) < timedelta(seconds=10)

software = {"name": "PolarBearSoft", "version": "1.2.3"}
entry = util.create_history_entry("There was a tie-dyed polar bear...", software)
Expand Down

0 comments on commit eac134f

Please sign in to comment.