Refactor imports and remove unused code in test_security.py

Cleaned up unused imports including `timezone` and `ExpiredSignatureError`. Streamlined the import structure to improve readability and maintainability. These changes do not affect functionality but enhance code clarity.
This commit is contained in:
2025-02-28 17:39:39 +01:00
parent af53b52c0c
commit aa77752981

View File

@@ -1,6 +1,8 @@
from datetime import timedelta, datetime
import pytest
from datetime import timedelta, datetime, timezone
from jose import jwt, JWTError, ExpiredSignatureError
from jose import jwt, JWTError
from app.auth.security import (
get_password_hash, verify_password,
create_access_token, create_refresh_token,
@@ -69,7 +71,6 @@ def test_decode_token_missing_exp():
assert str(exc_info.value) == "Malformed token. Missing required claim."
def test_decode_token_missing_sub():
# Create a token without the `sub` claim
payload = {"exp": datetime.now().timestamp() + 60, "type": "access"}