From 759993cc8f5885945e150fec0cea5a8f05679244 Mon Sep 17 00:00:00 2001 From: Tim Schilling Date: Thu, 27 May 2021 13:59:51 -0500 Subject: [PATCH] Example of latest requests having duplicate requests. --- .../bugfixes/nosetests/test_425_latest_requests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/bugfixes/nosetests/test_425_latest_requests.py b/tests/bugfixes/nosetests/test_425_latest_requests.py index 72578c87..ec010b89 100644 --- a/tests/bugfixes/nosetests/test_425_latest_requests.py +++ b/tests/bugfixes/nosetests/test_425_latest_requests.py @@ -1,3 +1,4 @@ +import re import requests import httpretty from httpretty.errors import UnmockedError @@ -27,3 +28,15 @@ def test_latest_requests(): requests.get('http://google.com/') httpretty.latest_requests().should.have.length_of(4) httpretty.latest_requests()[-1].url.should.equal('http://google.com/') + + +@httpretty.activate(allow_net_connect=True) +def test_latest_requests_with_enable(): + "#425 - httpretty.latest_requests() can be called multiple times" + httpretty.register_uri(httpretty.GET, 'https://google.com/', body="Not Google") + + requests.get('https://google.com/', data={"baz": "bar"}) + + httpretty.latest_requests()[-1].url.should.equal('https://google.com/') + httpretty.latest_requests().should.have.length_of(1) +