1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 09:13:23 +00:00

test that works behind proxy

This commit is contained in:
Hernan Ezequiel Di Giorgi
2020-04-27 21:34:04 -03:00
committed by Kevin McCarthy
parent 936feb7748
commit 04b7f4fc65
4 changed files with 106 additions and 1 deletions

View File

@@ -68,7 +68,11 @@ def _record_responses(cassette, vcr_request, real_response):
past_vcr_request = _make_vcr_request(past_real_response.request)
cassette.append(past_vcr_request, _to_serialized_response(past_real_response))
vcr_request = _make_vcr_request(real_response.request)
if real_response.history:
# If there was a redirection keep we want the request which will hold the
# final redirect value
vcr_request = _make_vcr_request(real_response.request)
cassette.append(vcr_request, _to_serialized_response(real_response))
return real_response