Skip to content

Commit

Permalink
Improve test_process_response_unrelated_domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallaecio committed Sep 8, 2023
1 parent 77bac46 commit 4d58842
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_downloadermiddleware_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,8 @@ def test_off_domain_jar_storage(self):

def test_process_response_unrelated_domain(self):
request = Request("http://a.example")
request.headers["Cookie"] = "foo=bar; domain=b.example"
response = Response("http://c.example")
response.headers["Set-Cookie"] = "foo=bar; domain=c.example"
response = Response("http://a.example")
response.headers["Set-Cookie"] = "foo=bar; domain=b.example"
self.mw.process_response(request, response, spider=None)
jar = self.mw.jars[None]
assert not jar._cookies.get(".c.example", {})
self.assertFalse(jar._cookies)

0 comments on commit 4d58842

Please sign in to comment.