I am trying to use the Pythons package to prototype the Pythons requests module. What are the basic requirements to get me to work in the script below?
In my views.py, I have a function that makes different requests.get () requests with different responses every time
def myview(request): res1 = requests.get('aurl') res2 = request.get('burl') res3 = request.get('curl')
In my test class, I want to do something similar, but I cannot understand the exact method calls
Step 1:
Step 2:
Call my mind
Step 3:
check the answer contains "answer", "answer b", "answer c"
How can I follow Step 1 (mock the query module)?
python mocking request
kk1957 Apr 01 '13 at 23:01
source share