Render body according to its request content type (#261)#331
Conversation
There was a problem hiding this comment.
Thank you for supporting ScanAPI, and congratulations on your first contribution! A project committer will shortly review your contribution.
In the mean time, if you haven't had a chance please skim over the First Pull Request Guide which all pull requests must adhere to.
We hope to see you around!
`body.decode()` is used only once.
…er-body-according-to-its-request-content-type
110f9ba to
0bbf0e0
Compare
…er-body-according-to-its-request-content-type
camilamaia
left a comment
There was a problem hiding this comment.
Hi @beatorizu, I am awfully sorry for the long delay answering you here. The last month was too busy and I didn't have time to follow all the PRs here.
The PR looks great, btw! I've just left one comment about tests. Please, let me know if you need any help 👍 And thanks for the contribution!
| return PackageLoader("scanapi", "templates") | ||
|
|
||
|
|
||
| def render_body(request): |
There was a problem hiding this comment.
Would it be possible to have tests for this? The test file for this part is https://github.com/scanapi/scanapi/blob/master/tests/unit/test_template_render.py
Here you can find a brief guideline to help you with the tests: https://github.com/scanapi/scanapi/wiki/Run-ScanAPI-Locally#tests
| <summary>Body</summary> | ||
| <p>{{ request.body }}</p> | ||
| <p class="json-body">{{ request|render_body }}</p> | ||
| <button class="copy__snippet">❏</button> |
|
I changed my setup recentely, so I will set the environment and add the test :) |
Resolves #261