Skip to content

Commit f17901c

Browse files
committed
Fix bug which set token creation time 1hr earlier
1 parent 304319f commit f17901c

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_bidstream_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_smoke_test(self, mock_refresh_bidstream_keys): # SmokeTest
2323
decrypted = self._client.decrypt_token_into_raw_uid(token, None)
2424
self.assertEqual(decrypted.identity_scope, expected_scope)
2525
self.assertEqual(decrypted.advertising_token_version, expected_version)
26+
self.assertEqual((now - decrypted.established).total_seconds(), 0)
2627

2728
def test_phone_uids(self, mock_refresh_bidstream_keys): # PhoneTest
2829
for expected_scope, expected_version in test_cases_all_scopes_v3_v4_versions:

tests/test_sharing_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_smoke_test(self, mock_refresh_sharing_keys): # SmokeTest
2323
decrypted = self._client.decrypt_token_into_raw_uid(token)
2424
self.assertEqual(decrypted.identity_scope, expected_scope)
2525
self.assertEqual(decrypted.advertising_token_version, expected_version)
26+
self.assertEqual((now - decrypted.established).total_seconds(), 0)
2627

2728
def test_token_lifetime_too_long_for_sharing(self, mock_refresh_sharing_keys): # TokenLifetimeTooLongForSharing
2829
expires_in_sec = dt.datetime.now(tz=timezone.utc) + dt.timedelta(days=31)

tests/uid2_token_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class Params:
1515
def __init__(self, expiry=dt.datetime.now(tz=timezone.utc) + dt.timedelta(hours=1),
16-
identity_scope=IdentityScope.UID2.value, token_created_at=dt.datetime.now(tz=timezone.utc) - dt.timedelta(hours=1)):
16+
identity_scope=IdentityScope.UID2.value, token_created_at=dt.datetime.now(tz=timezone.utc)):
1717
self.identity_scope = identity_scope
1818
self.token_expiry = expiry
1919
self.token_created_at = token_created_at

0 commit comments

Comments
 (0)