Skip to content

Commit fd4562a

Browse files
committed
Replace legacy python timestamp call with current implementation
1 parent d3c5401 commit fd4562a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/features/steps/post_migration_legacy_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# ===============================================================================
16-
from datetime import date, datetime
16+
from datetime import date, datetime, timezone
1717
from behave import given, when, then, register_type
1818
from behave.runner import Context
1919
import parse
@@ -394,7 +394,7 @@ def step_then_all_queryable(context: Context):
394394
def step_then_created_at_recent(context: Context):
395395
"""Assert created_at is recent."""
396396
created_at = context.retrieved_location.created_at.replace(tzinfo=None)
397-
now = datetime.utcnow()
397+
now = datetime.now(timezone.utc).replace(tzinfo=None)
398398
diff_seconds = abs((now - created_at).total_seconds())
399399
assert diff_seconds < 3600, "created_at should be within last hour"
400400

0 commit comments

Comments
 (0)