Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and totycro committed Feb 10, 2022
1 parent eb0f5dd commit b909ffe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,16 @@ def test_check_exp(self):

def test_check_token_not_expired_if_in_leeway(self):
token = MyToken()
token.set_exp('refresh_exp', lifetime=timedelta(days=1))
token.set_exp("refresh_exp", lifetime=timedelta(days=1))

datetime_in_leeway = token.current_time + timedelta(days=1)

with self.assertRaises(TokenError):
token.check_exp('refresh_exp', current_time=datetime_in_leeway)
token.check_exp("refresh_exp", current_time=datetime_in_leeway)

# a token 1 day expired is valid if leeway is 2 days
token.get_token_backend().leeway = timedelta(days=2).total_seconds()
token.check_exp('refresh_exp', current_time=datetime_in_leeway)
token.check_exp("refresh_exp", current_time=datetime_in_leeway)
token.get_token_backend().leeway = 0

def test_for_user(self):
Expand Down

0 comments on commit b909ffe

Please sign in to comment.