diff options
author | Zuul <zuul@review.opendev.org> | 2020-05-20 00:26:52 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-05-20 00:26:52 +0000 |
commit | b74e95c27fff46a3abf661fd6348b604cabf47db (patch) | |
tree | e77b2392eea0b634acad54c74e0749283cfd987a | |
parent | 63caf56bdb9d9ff8e515bb26a3f07cdbcdb6514e (diff) | |
parent | 247227f3f367be37db3292ecae130e3e02f18063 (diff) | |
download | keystone-b74e95c27fff46a3abf661fd6348b604cabf47db.tar.gz |
Merge "Change time faking for totp test" into stable/train
-rw-r--r-- | keystone/tests/unit/test_v3_auth.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/keystone/tests/unit/test_v3_auth.py b/keystone/tests/unit/test_v3_auth.py index 6d6c6f649..278d7f6e7 100644 --- a/keystone/tests/unit/test_v3_auth.py +++ b/keystone/tests/unit/test_v3_auth.py @@ -5306,9 +5306,9 @@ class TestAuthTOTP(test_v3.RestfulTestCase): secret = creds[-1]['blob'] past = datetime.datetime.utcnow() - datetime.timedelta(minutes=2) - with freezegun.freeze_time(past): - auth_data = self._make_auth_data_by_id( - totp._generate_totp_passcodes(secret)[0]) + self.useFixture(fixture.TimeFixture(past)) + auth_data = self._make_auth_data_by_id( + totp._generate_totp_passcodes(secret)[0]) # Stop the clock otherwise there is a chance of auth failure due to # getting a different TOTP between the call here and the call in the |