Add a test for the copy of cb_kwargs from Request to Response

This commit is contained in:
Adrián Chaves 2020-02-13 22:36:18 +01:00
parent df937d8280
commit 5ff9eb90ea
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,12 @@ class BaseResponseTest(unittest.TestCase):
r1 = self.response_class("http://www.example.com", body=b"Some body", request=req)
assert r1.meta is req.meta
def test_copy_cb_kwargs(self):
req = Request("http://www.example.com")
req.cb_kwargs['foo'] = 'bar'
r1 = self.response_class("http://www.example.com", body=b"Some body", request=req)
assert r1.cb_kwargs is req.cb_kwargs
def test_copy_inherited_classes(self):
"""Test Response children copies preserve their class"""