Skip to content

Commit

Permalink
test: Fix Cryptography deprecation warning (#7566)
Browse files Browse the repository at this point in the history
The `not_valid_after` property was deprecated in favor of
`not_valid_after_utc`. Both return a timestamp in UTC time so this seems
like a safe lateral move. See
[here](https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate.not_valid_after)
for more information.

```
/boulder/test/v2_integration.py:1405: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to not_valid_after_utc.
```
  • Loading branch information
pgporada authored Jul 2, 2024
1 parent 55c274d commit cb6fcc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/v2_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ def test_expiration_mailer():
order = chisel2.auth_and_issue([random_domain()], email=email_addr)
cert = parse_cert(order)
# Check that the expiration mailer sends a reminder
expiry = cert.not_valid_after
expiry = cert.not_valid_after_utc
no_reminder = expiry + datetime.timedelta(days=-31)
first_reminder = expiry + datetime.timedelta(days=-13)
last_reminder = expiry + datetime.timedelta(days=-2)
Expand Down

0 comments on commit cb6fcc2

Please sign in to comment.