From 6c55f7631883e2c8048cc135361c7958ff063c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 1 Mar 2022 13:43:56 +0100 Subject: [PATCH] Stop mixing keyword arguments and ** in function calls --- tests/test_downloadermiddleware_cookies.py | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tests/test_downloadermiddleware_cookies.py b/tests/test_downloadermiddleware_cookies.py index ec220f930..6da733bd1 100644 --- a/tests/test_downloadermiddleware_cookies.py +++ b/tests/test_downloadermiddleware_cookies.py @@ -291,17 +291,16 @@ class CookiesMiddlewareTest(TestCase): target = {'url': target} target.setdefault('status', 301) - request1 = Request(cookies=input_cookies, **source) + source['cookies'] = input_cookies + request1 = Request(**source) self.mw.process_request(request1, self.spider) cookies = request1.headers.get('Cookie') self.assertEqual(cookies, b"a=b" if cookies1 else None) - response = Response( - headers={ - 'Location': target['url'], - }, - **target, - ) + target['headers'] = { + 'Location': target['url'], + }, + response = Response(**target) self.assertEqual( self.mw.process_response(request1, response, self.spider), response, @@ -378,14 +377,13 @@ class CookiesMiddlewareTest(TestCase): target = {'url': target} target.setdefault('status', 301) - request1 = Request(headers={'Cookie': b'a=b'}, **source) + source['headers'] = {'Cookie': b'a=b'} + request1 = Request(**source) - response = Response( - headers={ - 'Location': target['url'], - }, - **target, - ) + target['headers'] = { + 'Location': target['url'], + } + response = Response(**target) request2 = self.redirect_middleware.process_response( request1,