From fb89271d84e1ff66b498c811079364bb3a66d7a2 Mon Sep 17 00:00:00 2001 From: Emily Hugenbruch Date: Mon, 24 Apr 2017 16:49:24 -0400 Subject: [PATCH] Replace oslo_utils.timeutils.isotime The function 'oslo_utils.timeutils.isotime()' is deprecated in version '1.6' and will be removed in a future version. We are using datetime.datetime.isoformat() instead. For more information: http://docs.openstack.org/developer/oslo.utils/api/timeutils.html#oslo_utils.timeutils.isotime Change-Id: I7d41e33bc42f8eb354c8a659123bf34e077a9626 Closes-Bug: #1514331 --- tempest/api/identity/admin/v3/test_trusts.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py index 339b4bb01d..0a163fcbbf 100644 --- a/tempest/api/identity/admin/v3/test_trusts.py +++ b/tempest/api/identity/admin/v3/test_trusts.py @@ -232,10 +232,12 @@ class TrustsV3TestJSON(BaseTrustsV3Test): # For example, when creating a trust, we will set the expiry time of # the trust to 2015-02-17T17:34:01.907051Z. However, if we make a GET # request on the trust, the response will contain the time rounded up - # to 2015-02-17T17:34:02.000000Z. That is why we shouldn't set flag - # "subsecond" to True when we invoke timeutils.isotime(...) to avoid - # problems with rounding. - expires_str = timeutils.isotime(at=expires_at) + # to 2015-02-17T17:34:02.000000Z. That is why we set microsecond to + # 0 when we invoke isoformat to avoid problems with rounding. + expires_at = expires_at.replace(microsecond=0) + # NOTE(ekhugen) Python datetime does not support military timezones + # since we used UTC we'll add the Z so our compare works. + expires_str = expires_at.isoformat() + 'Z' trust = self.create_trust(expires=expires_str) self.validate_trust(trust, expires=expires_str)