Replace oslo_utils.timeutils.isotime

Function 'oslo_utils.timeutils.isotime()' is deprecated in version '1.6'
and will be removed in a future version. We use
datetime.datetime.isoformat() instead.

For more informations:
https://docs.openstack.org/developer/oslo.utils/api/timeutils.html#oslo_utils.timeutil

Change-Id: Ie9161bbe036e24c657717b379f79bc64737587e2
This commit is contained in:
Vu Cong Tuan 2017-06-02 11:30:46 +07:00
parent ef8897f58b
commit d11423673f
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
from oslo_serialization import jsonutils as json
from oslo_utils import timeutils
@ -28,7 +29,7 @@ class TestVolumeDeletion(base.BaseAlmanachTest):
resp, tenant_id, volume = self.create_volume()
self.assertEqual(resp.status, 201)
delete_body = {'date': timeutils.isotime()}
delete_body = {'date': datetime.datetime.isoformat(timeutils.utcnow())}
resp, _ = self.almanach_client.delete_volume(volume['volume_id'], json.dumps(delete_body))
self.assertEqual(resp.status, 202)