aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNathaniel Manista <nathaniel@google.com>2016-05-20 08:26:07 -0700
committerNathaniel Manista <nathaniel@google.com>2016-05-20 08:26:07 -0700
commite54e28939cf985e4d25ef34f96162abd3ab65002 (patch)
treee7e2702f2675b485dc82f37d92c8f48fec3ae4c2 /tests
parentf0ba60300c982da0be28ea153f87f1eb574c7e0b (diff)
parent7408a645fe930a10bf559fdb346df6352ebd3d35 (diff)
downloadoauth2client-e54e28939cf985e4d25ef34f96162abd3ab65002.tar.gz
Merge pull request #488 from dhermes/swap-to-utcnow
Replacing now() with utcnow() in device info code.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_client.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index 7e39877..c3a7377 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -2351,8 +2351,8 @@ class TestDeviceFlowInfo(unittest2.TestCase):
with self.assertRaises(client.OAuth2DeviceCodeError):
DeviceFlowInfo.FromResponse(response)
- @mock.patch('oauth2client.client._NOW')
- def test_FromResponse_with_expires_in(self, dt_now):
+ @mock.patch('oauth2client.client._UTCNOW')
+ def test_FromResponse_with_expires_in(self, utcnow):
expires_in = 23
response = {
'device_code': self.DEVICE_CODE,
@@ -2362,7 +2362,7 @@ class TestDeviceFlowInfo(unittest2.TestCase):
}
now = datetime.datetime(1999, 1, 1, 12, 30, 27)
expire = datetime.datetime(1999, 1, 1, 12, 30, 27 + expires_in)
- dt_now.return_value = now
+ utcnow.return_value = now
result = DeviceFlowInfo.FromResponse(response)
expected_result = DeviceFlowInfo(self.DEVICE_CODE, self.USER_CODE,