Replace usage of pytz

The current usage can be replaced by built-in datatime module.

pytz is not currently in test requirements and it is no longer required
by oslo.utils in Python 3.11.

Change-Id: Ib490f5aebc5c84daf28edc3698694d70a74a4715
This commit is contained in:
Takashi Kajinami 2024-03-12 22:57:27 +09:00
parent 9989b9695f
commit 84dacbe8df
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@ import copy
import datetime
import jsonschema
import logging
import pytz
from unittest import mock
from oslo_context import context
@ -1097,7 +1096,7 @@ class _TestObject(object):
obj.obj_reset_changes()
self.assertEqual({}, obj.obj_get_changes())
timestamp = datetime.datetime(2001, 1, 1, tzinfo=pytz.utc)
timestamp = datetime.datetime(2001, 1, 1, tzinfo=datetime.timezone.utc)
with mock.patch.object(timeutils, 'utcnow') as mock_utcnow:
mock_utcnow.return_value = timestamp
obj.timestamp = timeutils.utcnow()