From 3a9c3ca2663aa4fdcacfe0a3d73061ec1946c54a Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Tue, 20 Dec 2016 16:51:35 -0200 Subject: [bug] fix expected new_expiry_date Previously, new_expiry_date was calculated by the key creation date + 1 week, but the proper behavior is today + 1 week, accordingly with gpg behavior. --- tests/integration/keymanager/test_keymanager.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/keymanager/test_keymanager.py b/tests/integration/keymanager/test_keymanager.py index cacdc704..5b805ea4 100644 --- a/tests/integration/keymanager/test_keymanager.py +++ b/tests/integration/keymanager/test_keymanager.py @@ -662,16 +662,15 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase): yield km.extend_key_expiration(validity='1w') - new_expiry_date = datetime.strptime( - KEY_EXPIRING_CREATION_DATE, '%Y-%m-%d') - new_expiry_date += timedelta(weeks=1) + new_expiry_date = date.today() + timedelta(weeks=1) + renewed_public_key = yield km.get_key(ADDRESS_EXPIRING, fetch_remote=False) renewed_private_key = yield km.get_key(ADDRESS_EXPIRING, private=True) - self.assertEqual(new_expiry_date.date(), + self.assertEqual(new_expiry_date, renewed_public_key.expiry_date.date()) - self.assertEqual(new_expiry_date.date(), + self.assertEqual(new_expiry_date, renewed_private_key.expiry_date.date()) self.assertEqual(key.fingerprint, renewed_public_key.fingerprint) self.assertEqual(key.fingerprint, renewed_private_key.fingerprint) -- cgit v1.2.3