Set 'Accept: application/json' for the TestApp.*_json requests?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 346
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on a Pyramid app, which exposes a json rest api.
In the functional tests, I'm using WebTest and its TestApp.*_json() methods to send json requests.
The app looks at (among other things) the Accept header, to know what to send back to the client.
The various TestApp.*_json() methods already set the Content-Type header to application/json, to tell the server that what is sent is json.
It seems to me that they should also set the Accept header to tell the server that the answer they expect should be json.
Does that make sense?
I'd be happy to send a pull request if you agree to this change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TestApp.*_json() entry points and their existing Content-Type handling, then inspect the related functional tests. Done means the JSON request methods also send an Accept: application/json header and the tests verify that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100