Skip to content

Commit 9a503d3

Browse files
remove-fullName
1 parent f58fbd8 commit 9a503d3

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

backend/src/users/schemas.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class UserCreate(UserBase):
2323
class UserRegister(SQLModel):
2424
email: EmailStr = Field(max_length=255)
2525
password: str = Field(min_length=8, max_length=40)
26-
full_name: str | None = Field(default=None, max_length=255)
27-
2826

2927
class UserPublic(UserBase):
3028
id: uuid.UUID

backend/tests/users/test_api.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,31 +62,27 @@ def test_register_user(client: TestClient, db: Session) -> None:
6262
with patch("src.core.config.settings.USERS_OPEN_REGISTRATION", True):
6363
username = random_email()
6464
password = random_lower_string()
65-
full_name = random_lower_string()
66-
data = {"email": username, "password": password, "full_name": full_name}
65+
data = {"email": username, "password": password}
6766
r = client.post(
6867
f"{settings.API_V1_STR}/users",
6968
json=data,
7069
)
7170
assert r.status_code == 200
7271
created_user = r.json()
7372
assert created_user["email"] == username
74-
assert created_user["full_name"] == full_name
7573

7674
user_query = select(User).where(User.email == username)
7775
user_db = db.exec(user_query).first()
7876
assert user_db
7977
assert user_db.email == username
80-
assert user_db.full_name == full_name
8178
assert verify_password(password, user_db.hashed_password)
8279

8380

8481
def test_register_user_forbidden_error(client: TestClient) -> None:
8582
with patch("src.core.config.settings.USERS_OPEN_REGISTRATION", False):
8683
username = random_email()
8784
password = random_lower_string()
88-
full_name = random_lower_string()
89-
data = {"email": username, "password": password, "full_name": full_name}
85+
data = {"email": username, "password": password}
9086
r = client.post(
9187
f"{settings.API_V1_STR}/users",
9288
json=data,
@@ -100,11 +96,9 @@ def test_register_user_forbidden_error(client: TestClient) -> None:
10096
def test_register_user_already_exists_error(client: TestClient) -> None:
10197
with patch("src.core.config.settings.USERS_OPEN_REGISTRATION", True):
10298
password = random_lower_string()
103-
full_name = random_lower_string()
10499
data = {
105100
"email": settings.FIRST_SUPERUSER,
106101
"password": password,
107-
"full_name": full_name,
108102
}
109103
client.post(f"{settings.API_V1_STR}/users", json=data)
110104
r = client.post(f"{settings.API_V1_STR}/users", json=data)

0 commit comments

Comments
 (0)