-
-
Notifications
You must be signed in to change notification settings - Fork 353
-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Response with query string, but match_querystring=False should raise a warning #211
Comments
Another example of someone stumbling over this is #203 |
Not opposed to that. I'd also be fine just changing match_querystring=True (implicit only) when you pass a URL with a querystring. |
@dcramer I like the idea of a giving |
I probably won’t have time, but if you throw up a PR I’m happy to review/merge |
Previously, adding a response with a query string without also setting match_querystring=True would provide confusing results, see getsentry#211. This commit changes the argument's default value to consider the URL and automatically enable match_querystring if a query string is detected in the response.
Previously, adding a response with a query string without also setting match_querystring=True would provide confusing results, see #211. This commit changes the argument's default value to consider the URL and automatically enable match_querystring if a query string is detected in the response.
Problem
I've debugged an unrelated part of the an application for hours before noticing that mocked responses were matched unexpectedly, due to me not seeing the default
match_querystring=False
. A naive test case might do something like this:Proposal
While I'd prefer the default for
match_querystring
to be changed, I'd propose responses throws aRuntimeWarning
when a response is added that contains a query string without settingmatch_querystring
explicitly.The text was updated successfully, but these errors were encountered: