Skip to content

Commit

Permalink
chore: use native Python datetime object
Browse files Browse the repository at this point in the history
  • Loading branch information
JP-Ellis authored Oct 7, 2024
1 parent 2f084b0 commit 951823a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/tests/v3/test_00_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def test_get_existing_user(pact: Pact) -> None:
"id": 123,
"name": "Verna Hampton",
"created_on": match.datetime(
datetime.now(tz=timezone.utc).isoformat(),
# Python datetime objects are automatically formatted
datetime.now(tz=timezone.utc),
format="%Y-%m-%dT%H:%M:%S.%fZ",
),
}
Expand Down Expand Up @@ -139,7 +140,8 @@ def test_create_user(pact: Pact) -> None:
"id": 124,
"name": "Verna Hampton",
"created_on": match.datetime(
datetime.now(tz=timezone.utc).isoformat(),
# Python datetime objects are automatically formatted
datetime.now(tz=timezone.utc),
format="%Y-%m-%dT%H:%M:%S.%fZ",
),
}
Expand Down

0 comments on commit 951823a

Please sign in to comment.