Closed victorevector closed 9 years ago
U can set match_querystring
to True
in add
method:
responses.add(responses.GET,
url,
body = json_response,
content_type ='application/json',
status = 200,
match_querystring=True
)
Thank you Freylis!
It actually should be in docs somewhere..
After hours of trying to write tests and having completely random fails and passes, I also agree with @kiddick that this should be in the docs somewhere.
Hi everybody,
I've written up a test that only fails when a '?' is present in the url. The url in question (and used by both Requests and Responses) is "https://api.23andme.com/1/demo/genotypes/c4480ba411939067/?locations=rs3094315". I've ran the test twice. Once with the '?' available to both requests and responses and another with the '?' omitted from the url. The former failed whereas the latter passed.
Any insight into what the problem may be? I have pasted both the test method and the interpreter's error message below. One thing I've noticed in the error message is that Responses's '_find_match' method isn't being called. I'm not sure if that's of any importance...
Test method in question:
Error Message: