()
| 190 | |
| 191 | |
| 192 | def test_environ_builder_json(): |
| 193 | @Request.application |
| 194 | def app(request): |
| 195 | assert request.content_type == "application/json" |
| 196 | return Response(json.loads(request.get_data(as_text=True))["foo"]) |
| 197 | |
| 198 | c = Client(app) |
| 199 | response = c.post("/", json={"foo": "bar"}) |
| 200 | assert response.text == "bar" |
| 201 | |
| 202 | with pytest.raises(TypeError): |
| 203 | c.post("/", json={"foo": "bar"}, data={"baz": "qux"}) |
| 204 | |
| 205 | |
| 206 | def test_environ_builder_headers(): |