Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds prefixes to current context AFTER route resolution #7

Merged
merged 7 commits into from
Dec 7, 2023

Conversation

Natan16
Copy link
Contributor

@Natan16 Natan16 commented Dec 6, 2023

Closes #6

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2023

CLA assistant check
All committers have signed the CLA.

@Natan16
Copy link
Contributor Author

Natan16 commented Dec 6, 2023

Test missing for the recently added behavior

Comment on lines 19 to 22
assert mock_set_prefix.call_args_list[0].kwargs == {"key": "view_name", "value": "hello_world"}
assert mock_set_prefix.call_args_list[1].kwargs == {"key": "route", "value": "/hello"}
assert mock_remove_prefix.call_args_list[0].args[0] == "view_name"
assert mock_remove_prefix.call_args_list[1].args[0] == "route"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert mock_set_prefix.call_args_list[0].kwargs == {"key": "view_name", "value": "hello_world"}
assert mock_set_prefix.call_args_list[1].kwargs == {"key": "route", "value": "/hello"}
assert mock_remove_prefix.call_args_list[0].args[0] == "view_name"
assert mock_remove_prefix.call_args_list[1].args[0] == "route"
mock_set_prefix.assert_has_calls(
[
mock.call(key="view_name", value=f"test_middlewares.hello_world"),
mock.call(key="route", value=f"/hello"),
]
)
mock_remove_prefix.assert_has_calls(
[
mock.call("view_name"),
mock.call("route"),
],
)

@ecarrara ecarrara merged commit df7297c into buserbrasil:main Dec 7, 2023
12 of 13 checks passed
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.

resolve executed inside middleware breaks Django's default behavior when APPEND_SLASH is True
3 participants