@@ -262,7 +262,7 @@ def test_http_response_json():
262
262
response = HttpResponse (url , body = b'{"key": "value"}' )
263
263
assert response .json () == {"key" : "value" }
264
264
265
- response = HttpResponse (url , '{"ключ": "значение"}' .encode ("utf8" ))
265
+ response = HttpResponse (url , body = '{"ключ": "значение"}' .encode ("utf8" ))
266
266
assert response .json () == {"ключ" : "значение" }
267
267
268
268
@@ -274,7 +274,7 @@ def test_http_response_text():
274
274
"""
275
275
text = "œ is a Weird Character"
276
276
body = HttpResponseBody (b"\x9c is a Weird Character" )
277
- response = HttpResponse ("http://example.com" , body )
277
+ response = HttpResponse ("http://example.com" , body = body )
278
278
279
279
assert response .text == text
280
280
@@ -293,7 +293,7 @@ def test_http_headers_declared_encoding(headers, encoding):
293
293
headers = HttpResponseHeaders (headers )
294
294
assert headers .declared_encoding () == encoding
295
295
296
- response = HttpResponse ("http://example.com" , b'' , headers = headers )
296
+ response = HttpResponse ("http://example.com" , body = b'' , headers = headers )
297
297
assert response .encoding == encoding or HttpResponse ._DEFAULT_ENCODING
298
298
299
299
@@ -307,14 +307,14 @@ def test_http_response_utf16():
307
307
308
308
309
309
def test_explicit_encoding ():
310
- response = HttpResponse ("http://www.example.com" , "£" .encode ('utf-8' ),
310
+ response = HttpResponse ("http://www.example.com" , body = "£" .encode ('utf-8' ),
311
311
encoding = 'utf-8' )
312
312
assert response .encoding == "utf-8"
313
313
assert response .text == "£"
314
314
315
315
316
316
def test_explicit_encoding_invalid ():
317
- response = HttpResponse ("http://www.example.com" , "£" .encode ('utf-8' ),
317
+ response = HttpResponse ("http://www.example.com" , body = "£" .encode ('utf-8' ),
318
318
encoding = 'latin1' )
319
319
assert response .encoding == "latin1"
320
320
assert response .text == "£" .encode ('utf-8' ).decode ("latin1" )
0 commit comments