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

Allow filtering post params in requests

This commit is contained in:
Jonathan
2015-06-24 16:23:00 +01:00
parent 731a33a79a
commit ccc1ccaa0e
2 changed files with 18 additions and 2 deletions

View File

@@ -217,3 +217,16 @@ def test_post_file(tmpdir, scheme):
with open('tox.ini', 'rb') as f:
new_response = requests.post(url, f).content
assert original_response == new_response
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.
'''
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'})