Slide 65
Slide 65 text
def
spec_using_valid_oauth_credentials(self,
harness):
auth
=
OAuth1("mykey",
"mysecret")
body_data
=
"{'function':
'tick'}"
harness.reset_data()
response
=
requests.post(root_url,
data=body_data,
auth=auth,
headers={'Content-‐Type':
'application/json'})
assert
response.status_code
==
200
assert
"Authorization"
in
harness.forwarded_headers
assert
"Oauth"
in
harness.forwarded_headers["Authorization"]
assert
harness.forwarded_body
==
body_data