(encoding)
| 849 | ], |
| 850 | ) |
| 851 | def test_json_with_specified_charset(encoding): |
| 852 | data = {"greeting": "hello", "recipient": "world"} |
| 853 | content = json.dumps(data).encode(encoding) |
| 854 | headers = {"Content-Type": f"application/json; charset={encoding}"} |
| 855 | response = httpx.Response( |
| 856 | 200, |
| 857 | content=content, |
| 858 | headers=headers, |
| 859 | ) |
| 860 | assert response.json() == data |
| 861 | |
| 862 | |
| 863 | @pytest.mark.parametrize( |