Skip to content

Render body according to its request content type (#261)#331

Merged
camilamaia merged 12 commits intoscanapi:masterfrom
beatorizu:render-body-according-to-its-request-content-type
Dec 16, 2020
Merged

Render body according to its request content type (#261)#331
camilamaia merged 12 commits intoscanapi:masterfrom
beatorizu:render-body-according-to-its-request-content-type

Conversation

@beatorizu
Copy link
Copy Markdown
Contributor

Resolves #261

@beatorizu beatorizu requested review from a team as code owners October 30, 2020 22:22
@github-actions github-actions bot added the First Contribution First contribution to the project. label Oct 30, 2020
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread scanapi/template_render.py Outdated
Comment thread scanapi/template_render.py Outdated
…er-body-according-to-its-request-content-type
@beatorizu beatorizu force-pushed the render-body-according-to-its-request-content-type branch from 110f9ba to 0bbf0e0 Compare November 23, 2020 17:46
…er-body-according-to-its-request-content-type
Copy link
Copy Markdown
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">&#10063;</button>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

@beatorizu
Copy link
Copy Markdown
Contributor Author

I changed my setup recentely, so I will set the environment and add the test :)

@camilamaia camilamaia self-requested a review December 16, 2020 12:45
Copy link
Copy Markdown
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

@camilamaia camilamaia merged commit 92e7e9e into scanapi:master Dec 16, 2020
@beatorizu beatorizu deleted the render-body-according-to-its-request-content-type branch December 28, 2020 14:23
@camilamaia camilamaia mentioned this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First Contribution First contribution to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Body in the report should be rendered according to it's request content type

3 participants