-
Notifications
You must be signed in to change notification settings - Fork 889
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
add a callback hook to set_default_csrf_options for disabling checks … #2778
Conversation
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.
LGTM
|
||
def test_changing_set_default_csrf_options(self): | ||
from pyramid.interfaces import IDefaultCSRFOptions | ||
config = self._makeOne(autocommit=True) | ||
def callback(request): return True |
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.
Why the single-line function here?
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.
The function is never executed in this test, so it's either that or a pragma or a lambda. A lot of the other tests use this pattern to keep coverage.
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.
callback = lambda x: True
gives pep8 warnings, since you aren't supposed to assign a lambda to a variable...
LGTM. |
…per-request
fixes #2596