Skip to content

Commit c80047e

Browse files
committed
test fixed
1 parent 4136a8d commit c80047e

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

huntflow_api_client/entities/applicants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async def patch(
108108
response = await self._api.request(
109109
"PATCH",
110110
f"/accounts/{account_id}/applicants/{applicant_id}",
111-
json=data.jsonable_dict(exclude_none=True, exclude_unset=True),
111+
json=data.jsonable_dict(exclude_unset=True),
112112
)
113113
return ApplicantItem.model_validate(response.json())
114114

huntflow_api_client/models/request/applicants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ApplicantCreateRequest(Applicant, JsonRequestModel):
4848
class ApplicantUpdateRequest(Applicant, JsonRequestModel):
4949
birthday: Optional[date] = Field(None, description="Date of birth")
5050
social: Optional[List[ApplicantSocial]] = Field(
51-
[],
51+
None,
5252
max_length=1,
5353
description="List of applicant's social accounts",
5454
)

tests/test_entities/test_applicants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
from typing import Any, Dict
23

34
from pytest_httpx import HTTPXMock
@@ -199,7 +200,7 @@
199200
},
200201
],
201202
}
202-
APPLICANT_PATCH_REQUEST: Dict[str, Any] = {"first_name": "Newname"}
203+
APPLICANT_PATCH_REQUEST: Dict[str, Any] = {"first_name": "Newname", "social": []}
203204
APPLICANT_PATCH_RESPONSE: Dict[str, Any] = {
204205
"first_name": "Newname",
205206
"last_name": "Doe",
@@ -324,6 +325,7 @@ async def test_patch_applicant(
324325
) -> None:
325326
httpx_mock.add_response(
326327
url=f"{VERSIONED_BASE_URL}/accounts/{ACCOUNT_ID}/applicants/{APPLICANT_ID}",
328+
match_content=json.dumps(APPLICANT_PATCH_REQUEST).encode(),
327329
json=APPLICANT_PATCH_RESPONSE,
328330
)
329331
api_client = HuntflowAPI(BASE_URL, token_proxy=token_proxy)

0 commit comments

Comments
 (0)