Skip to content

Commit ff50342

Browse files
committed
DOn't dump data by casting to string
1 parent d81c7be commit ff50342

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/mock_vws/fixtures/prepared_requests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ def _add_target(
6666
prepared_request = request.prepare() # type: ignore
6767

6868
return TargetAPIEndpoint(
69-
# We expect a bad request error because we have not given the required
70-
# JSON body elements.
7169
successful_headers_status_code=codes.BAD_REQUEST,
7270
successful_headers_result_code=ResultCodes.FAIL,
7371
prepared_request=prepared_request,
@@ -397,7 +395,7 @@ def _update_target(
397395
)
398396
data: Dict[str, Any] = {}
399397
request_path = f'/targets/{target_id}'
400-
content = bytes(str(data), encoding='utf-8')
398+
content = bytes(json.dumps(data), encoding='utf-8')
401399
content_type = 'application/json'
402400

403401
date = rfc_1123_date()

0 commit comments

Comments
 (0)