Change time faking for totp test
This change moves the time mocking from using freezegun to using oslo.utils TimeFixture for the unit test test_with_passcode_in_previous_windows_extended, which was occasionally failing with 401 errors due to the totp creation time not properly be faked with 4 extended windows. Closes-Bug: #1843464 Change-Id: I3aefd99907fbc2d03538c9814f7279b282715679
This commit is contained in:
parent
62cd34d40d
commit
6525203c1a
|
@ -5304,7 +5304,7 @@ class TestAuthTOTP(test_v3.RestfulTestCase):
|
||||||
secret = creds[-1]['blob']
|
secret = creds[-1]['blob']
|
||||||
|
|
||||||
past = datetime.datetime.utcnow() - datetime.timedelta(minutes=2)
|
past = datetime.datetime.utcnow() - datetime.timedelta(minutes=2)
|
||||||
with freezegun.freeze_time(past):
|
self.useFixture(fixture.TimeFixture(past))
|
||||||
auth_data = self._make_auth_data_by_id(
|
auth_data = self._make_auth_data_by_id(
|
||||||
totp._generate_totp_passcodes(secret)[0])
|
totp._generate_totp_passcodes(secret)[0])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue