Skip to content

Commit

Permalink
Use actual dumps in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Dec 15, 2024
1 parent 7598858 commit aa83b5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sanic.constants import DEFAULT_HTTP_CONTENT_TYPE
from sanic.exceptions import ServerError
from sanic.request import RequestParameters
from sanic.response import html, json, text
from sanic.response import BaseHTTPResponse, html, json, text


def encode_basic_auth_credentials(username, password):
Expand Down Expand Up @@ -2253,8 +2253,9 @@ async def delete(request, foo):
{"name": request.route.name, "body": str(request.body), "foo": foo}
)

dumps = BaseHTTPResponse._dumps
payload = {"test": "OK"}
data = str(json_dumps(payload).encode())
data = str(dumps(payload).encode())

_, response = app.test_client.put("/", json=payload)
assert response.status == 200
Expand Down

0 comments on commit aa83b5d

Please sign in to comment.