fix(api): return 422 for validation errors with serializable payloads [FASE-3.3]
This commit is contained in:
@@ -42,6 +42,14 @@ class TestUsernameValidation:
|
||||
with pytest.raises(ValidationError, match="3-50 characters"):
|
||||
UserCreate(username="john@doe", password="SecurePass123!@#")
|
||||
|
||||
def test_reserved_username_system(self):
|
||||
with pytest.raises(ValidationError):
|
||||
UserCreate(username="system", password="SecurePass123!@#")
|
||||
|
||||
def test_invalid_username_path_chars(self):
|
||||
with pytest.raises(ValidationError):
|
||||
UserCreate(username="../admin", password="SecurePass123!@#")
|
||||
|
||||
def test_reserved_username_admin(self):
|
||||
with pytest.raises(ValidationError, match="reserved"):
|
||||
UserCreate(username="admin", password="SecurePass123!@#")
|
||||
|
||||
Reference in New Issue
Block a user