From 4a4c96ce9b28ed54f93a21ca405c5b34ef3c3429 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Wed, 8 May 2019 14:00:26 +0200 Subject: [PATCH] Make tests pass in 2022 Background: As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future. The usual offset is +15 years, because that is how long I expect some software will be used in some places. This showed up failing tests in our package build. See https://reproducible-builds.org/ for why this matters. This makes it expire 1 year in the future to model realistic tokens. Change-Id: I73bde68be53afff4e8dff12d756b8381f34b2adb --- .../tests/unit/auth_token/test_auth_token_middleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py index 9fd0328a..a09d269d 100644 --- a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py +++ b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py @@ -83,7 +83,8 @@ BASE_URI = '%s/testadmin' % BASE_HOST FAKE_ADMIN_TOKEN_ID = 'admin_token2' FAKE_ADMIN_TOKEN = jsonutils.dumps( {'access': {'token': {'id': FAKE_ADMIN_TOKEN_ID, - 'expires': '2022-10-03T16:58:01Z'}}}) + 'expires': '%i-10-03T16:58:01Z' % + (1 + time.gmtime().tm_year)}}}) VERSION_LIST_v3 = fixture.DiscoveryList(href=BASE_URI) VERSION_LIST_v2 = fixture.DiscoveryList(v3=False, href=BASE_URI)