KEMBAR78
tests: assert jinja templates are all rendered correctly. by maiku1008 · Pull Request #6765 · pypi/warehouse · GitHub
Skip to content

Conversation

@maiku1008
Copy link
Contributor

@maiku1008 maiku1008 commented Oct 5, 2019

Hi all, I added a unit test that should address #6634

I opted to try rendering all templates instead of just the specified one.

Fixes #6634.

Comment on lines 90 to 108
env.filters.update(
{
"format_date": "warehouse.i18n.filters:format_date",
"format_datetime": "warehouse.i18n.filters:format_datetime",
"format_rfc822_datetime": "warehouse.i18n.filters:format_rfc822_datetime",
"format_number": "warehouse.i18n.filters:format_number",
"format_classifiers": "warehouse.filters:format_classifiers",
"classifier_id": "warehouse.filters:classifier_id",
"format_tags": "warehouse.filters:format_tags",
"json": "warehouse.filters:tojson",
"camoify": "warehouse.filters:camoify",
"shorten_number": "warehouse.filters:shorten_number",
"urlparse": "warehouse.filters:urlparse",
"contains_valid_uris": "warehouse.filters:contains_valid_uris",
"format_package_type": "warehouse.filters:format_package_type",
"parse_version": "warehouse.filters:parse_version",
"localize_datetime": "warehouse.filters:localize_datetime",
}
)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we can automatically generate this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense, would you have any suggestions on how to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just bumping, would love to have this merged :)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, might be a bit much for this PR. At the very least, can we not duplicate this between the two tests in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing, all done!

@maiku1008 maiku1008 force-pushed the add-unit-test-for-jinja-templates branch from 697254c to e9fd039 Compare October 10, 2019 09:51
@maiku1008 maiku1008 force-pushed the add-unit-test-for-jinja-templates branch from e9fd039 to 92f399d Compare October 10, 2019 13:47
@maiku1008
Copy link
Contributor Author

Is there anything else I can improve for this? :)

@di di merged commit 1938466 into pypi:master Oct 12, 2019
@di
Copy link
Member

di commented Oct 12, 2019

Thanks!

@maiku1008 maiku1008 deleted the add-unit-test-for-jinja-templates branch October 12, 2019 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing test for project detail page (template failure)

2 participants