Skip to content
Myr

changed the null check for 'data' parameter to be more explicit.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

removed the superfluous encode from the testcase.

authored by Ravi Prakash Putchala · committed by Ravi Prakash Putchala · parent 3703760 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:requests/models.py+1 added-1 removed
412 unmodified lines
413 body = None414 content_type = None415 length = None416417 if not data and json is not None:417 if data == {} and json is not None:418 content_type = 'application/json'419 body = complexjson.dumps(json)420421 is_stream = all([
427 unmodified lines
modified:test_requests.py+1 added-1 removed
1063 unmodified lines
10641065 def test_json_param_post_should_not_override_data_param(self):1066 r = requests.Request(method='POST', url='http://httpbin.org/post',1067 data={'stuff'.encode('utf-8'): 'elixr'},1068 json={'music'.encode('utf-8'): 'flute'})1068 json={'music': 'flute'})1069 prep = r.prepare()1070 assert 'stuff=elixr' == prep.body10711072 def test_response_iter_lines(self):
612 unmodified lines