Application fully migrated to modular approach
This commit is contained in:
@@ -17,7 +17,7 @@ class TestAuthenticationAPI:
|
||||
assert data["email"] == "newuser@example.com"
|
||||
assert data["username"] == "newuser"
|
||||
assert data["role"] == "user"
|
||||
assert data["is_active"] == True
|
||||
assert data["is_active"] is True
|
||||
assert "hashed_password" not in data
|
||||
|
||||
def test_register_user_duplicate_email(self, client, test_user):
|
||||
@@ -84,11 +84,11 @@ class TestAuthenticationAPI:
|
||||
assert data["username"] == test_user.username
|
||||
assert data["email"] == test_user.email
|
||||
|
||||
def test_get_current_user_no_auth(self, client):
|
||||
def test_get_current_user_without_auth(self, client):
|
||||
"""Test getting current user without authentication"""
|
||||
response = client.get("/api/v1/auth/me")
|
||||
|
||||
assert response.status_code == 403 # No authorization header
|
||||
assert response.status_code == 401 # No authorization header
|
||||
|
||||
|
||||
class TestAuthManager:
|
||||
@@ -105,8 +105,8 @@ class TestAuthManager:
|
||||
password = "testpassword123"
|
||||
hashed = auth_manager.hash_password(password)
|
||||
|
||||
assert auth_manager.verify_password(password, hashed) == True
|
||||
assert auth_manager.verify_password("wrongpassword", hashed) == False
|
||||
assert auth_manager.verify_password(password, hashed) is True
|
||||
assert auth_manager.verify_password("wrongpassword", hashed) is False
|
||||
|
||||
def test_create_access_token(self, auth_manager, test_user):
|
||||
"""Test JWT token creation"""
|
||||
|
||||
Reference in New Issue
Block a user