Skip to content

Commit

Permalink
Test for application/json; charset=utf-8
Browse files Browse the repository at this point in the history
Refs #2384, #2392
  • Loading branch information
simonw committed Aug 15, 2024
1 parent cf4274f commit 492378c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_api_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,22 @@ def _headers(token):


@pytest.mark.asyncio
async def test_insert_row(ds_write):
@pytest.mark.parametrize(
"content_type",
(
"application/json",
"application/json; charset=utf-8",
),
)
async def test_insert_row(ds_write, content_type):
token = write_token(ds_write)
response = await ds_write.client.post(
"/data/docs/-/insert",
json={"row": {"title": "Test", "score": 1.2, "age": 5}},
headers=_headers(token),
headers={
"Authorization": "Bearer {}".format(token),
"Content-Type": content_type,
},
)
expected_row = {"id": 1, "title": "Test", "score": 1.2, "age": 5}
assert response.status_code == 201
Expand Down

0 comments on commit 492378c

Please sign in to comment.