Skip to content

Commit

Permalink
Merge pull request #78 from lundberg/default-content-type
Browse files Browse the repository at this point in the history
Test text content without specifying content type
  • Loading branch information
lundberg committed Oct 2, 2020
2 parents ee95e16 + 3ac4bfd commit 706ae48
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,17 @@ async def test_headers(client, headers, content_type, expected):

@pytest.mark.asyncio
@pytest.mark.parametrize(
"content,expected", [(b"eldr\xc3\xa4v", "eldräv"), ("äpple", "äpple")]
"content,expected",
[
(b"eldr\xc3\xa4v", "eldräv"),
("äpple", "äpple"),
("Gehäusegröße", "Gehäusegröße"),
],
)
async def test_text_content(client, content, expected):
async with MockTransport() as respx_mock:
url = "https://foo.bar/"
content_type = "text/plain; charset=utf-8" # TODO: Remove once respected
request = respx_mock.post(url, content=content, content_type=content_type)
request = respx_mock.post(url, content=content)
response = await client.post(url)
assert request.called is True
assert response.text == expected
Expand Down

0 comments on commit 706ae48

Please sign in to comment.