From: Jonathan Date: Wed, 24 Jun 2015 15:27:45 +0000 (+0100) Subject: Update test to ensure that filter is correctly applied X-Git-Tag: v1.6.0~4^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e742d32a8aaf5ec4592476189423f5ab78544275;p=vcrpy.git Update test to ensure that filter is correctly applied --- diff --git a/tests/integration/test_requests.py b/tests/integration/test_requests.py index 656754e..79e74b8 100644 --- a/tests/integration/test_requests.py +++ b/tests/integration/test_requests.py @@ -224,9 +224,13 @@ def test_filter_post_params(tmpdir, scheme): This tests the issue in https://github.com/kevin1024/vcrpy/issues/158 Ensure that a post request made through requests can still be filtered. + with vcr.use_cassette(cass_file, filter_post_data_parameters=['id']) as cass: + assert b'id=secret' not in cass.requests[0].body ''' url = scheme + '://httpbin.org/post' cass_loc = str(tmpdir.join('filter_post_params.yaml')) with vcr.use_cassette(cass_loc, filter_post_data_parameters=['key']) as cass: requests.post(url, data={'key': 'value'}) + with vcr.use_cassette(cass_loc, filter_post_data_parameters=['key']) as cass: + assert b'key=value' not in cass.requests[0].body