File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22#
33# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
44
5- from datetime import datetime , timedelta , timezone
5+ from datetime import datetime , timedelta
66import time
77import itsdangerous
88import pytest
@@ -138,7 +138,7 @@ def assert_locked():
138138 # counter was at 3; one new failure pushes it to 4, crossing tier-2 threshold
139139
140140 # expire_lock
141- user .locked_until = datetime .now ( tz = timezone . utc ) - timedelta (seconds = 1 )
141+ user .locked_until = datetime .utcnow ( ) - timedelta (seconds = 1 )
142142 db .session .commit ()
143143
144144 resp = client .post (
@@ -148,11 +148,11 @@ def assert_locked():
148148 # returns 401 (wrong password), but now locked for 3600s
149149 assert resp .status_code == 401
150150 assert_locked ()
151- assert user .locked_until > datetime .now ( tz = timezone . utc ) + timedelta (seconds = 60 )
151+ assert user .locked_until > datetime .utcnow ( ) + timedelta (seconds = 60 )
152152 assert user .failed_login_attempts == 4
153153
154154 # successful login after expiry resets everything
155- user .locked_until = datetime .now ( tz = timezone . utc ) - timedelta (seconds = 1 )
155+ user .locked_until = datetime .utcnow ( ) - timedelta (seconds = 1 )
156156 db .session .commit ()
157157 resp = client .post (
158158 url_for ("/.mergin_auth_controller_login" ),
Original file line number Diff line number Diff line change 1212
1313# revision identifiers, used by Alembic.
1414revision = "a3c8f2e1d947"
15- down_revision = "a1b2c3d4e5f6 "
15+ down_revision = "f1d9e4a7b823 "
1616branch_labels = None
1717depends_on = None
1818
You can’t perform that action at this time.
0 commit comments