Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 425: Example of latest requests having duplicate requests. #433

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/bugfixes/nosetests/test_425_latest_requests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import requests
import httpretty
from httpretty.errors import UnmockedError
Expand Down Expand Up @@ -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)