mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: replace deprecated datetime functions
tests show warnings for deprecated utc functions with python 3.12 Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
ffddf63975
commit
afb7af3e27
9 changed files with 21 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
import re
|
||||
import tempfile
|
||||
from datetime import datetime
|
||||
from datetime import UTC, datetime
|
||||
from http import HTTPStatus
|
||||
from logging import DEBUG
|
||||
from subprocess import Popen
|
||||
|
@ -394,7 +394,7 @@ def test_post_register_error_ip_banned(client: TestClient):
|
|||
# 'testclient' is our fallback value in case request.client is None
|
||||
# which is the case for TestClient
|
||||
with db.begin():
|
||||
create(Ban, IPAddress="testclient", BanTS=datetime.utcnow())
|
||||
create(Ban, IPAddress="testclient", BanTS=datetime.now(UTC))
|
||||
|
||||
with client as request:
|
||||
response = post_register(request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue