Refactor tests to remove redundant user validation cases.
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped

Removed tests for missing `first_name` and `last_name` in `test_user` as database integrity constraints already ensure these validations. This reduces duplication and simplifies the test suite.
This commit is contained in:
2025-03-04 19:11:13 +01:00
parent a88ebd40a7
commit 4f06c95eda
2 changed files with 0 additions and 26 deletions

View File

@@ -165,32 +165,6 @@ def test_user_required_fields(db_session):
db_session.commit()
db_session.rollback()
# Missing first_name
user_no_firstname = User(
id=uuid.uuid4(),
email="nofirstname@example.com",
password_hash="hashedpassword",
# first_name is missing
last_name="User",
)
db_session.add(user_no_firstname)
with pytest.raises(IntegrityError):
db_session.commit()
db_session.rollback()
# Missing last_name
user_no_lastname = User(
id=uuid.uuid4(),
email="nolastname@example.com",
password_hash="hashedpassword",
first_name="Test",
# last_name is missing
)
db_session.add(user_no_lastname)
with pytest.raises(IntegrityError):
db_session.commit()
db_session.rollback()
def test_user_defaults(db_session):
"""Test that default values are correctly set."""