-
Notifications
You must be signed in to change notification settings - Fork 438
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
Fix exception serialization in user deletion #8450
Conversation
@@ -144,8 +144,8 @@ def users_delete(request): | |||
|
|||
|
|||
@view_config(context=UserNotFoundError) | |||
def user_not_found(exc, request): # pragma: no cover | |||
request.session.flash(Markup(_(exc.message)), "error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only non-test code change in the PR.
@@ -75,19 +76,6 @@ def test_users_index_strips_spaces(models, pyramid_request): | |||
models.User.get_by_username.assert_called_with(pyramid_request.db, "bob", "foo.org") | |||
|
|||
|
|||
@users_index_fixtures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged some tests in this file, they were one-assertion-per-test style which becomes verbose pretty quickly. Done in a separate commit.
@@ -204,6 +153,13 @@ def test_users_delete_user_not_found_error(user_service, pyramid_request): | |||
users_delete(pyramid_request) | |||
|
|||
|
|||
def test_user_not_found_view(pyramid_request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test for previously un-tested view.
cff1e02
to
2ec6058
Compare
2ec6058
to
a116675
Compare
Fixes: https://hypothesis.sentry.io/issues/4905837844/?project=37293&referrer=github-pr-bot
Took the opportunity to refactor some tests around this file.