Skip to content

Commit

Permalink
Compute timestamp in auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
markhobson committed Jun 3, 2024
1 parent 8f0ade7 commit ecd7eac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/integration/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import datetime
from typing import Any, Generator, Mapping

import pytest
Expand All @@ -20,8 +21,6 @@


class TestAuth:
YEAR_3000 = 32503680000

@pytest.fixture(name="client_id", scope="class")
def client_id_fixture(self) -> str:
return "stub_client_id"
Expand Down Expand Up @@ -141,7 +140,7 @@ def test_callback_when_id_token_expired_raises_error(
def test_callback_when_id_token_issued_in_future_raises_error(
self, oidc_server: StubOidcServer, client: FlaskClient
) -> None:
oidc_server.given_token_endpoint_returns_id_token(issued_at=self.YEAR_3000, nonce="456")
oidc_server.given_token_endpoint_returns_id_token(issued_at=int(datetime(3000, 1, 1).timestamp()), nonce="456")
given_session_has_authentication_request(client, state="123", nonce="456")

with pytest.raises(
Expand Down

0 comments on commit ecd7eac

Please sign in to comment.