I have this URL and im successfully able to call this responses.
https://www.udemy.com/api-2.0/courses/?page=1&page_size=5
Now, I'm trying to mock the responses and testing my api but mock throws a ConnectionError
with responses.RequestsMock() as rsps:
url = 'https://www.udemy.com/api-2.0/courses/?page=1&page_size=5'
rsps.add(responses.GET, url,
body=mocked_json, status=status_code,
content_type='application/json')
Error:-
ConnectionError: Connection refused: GET https://www.udemy.com/api-2.0/courses?page=1&page_size=5