Home / Function/ test_cookie_duplicate_names_different_domains() — requests Function Reference

test_cookie_duplicate_names_different_domains() — requests Function Reference

Architecture documentation for the test_cookie_duplicate_names_different_domains() function in test_requests.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  52ca08f3_eb8b_ae91_8325_d152af372ad1["test_cookie_duplicate_names_different_domains()"]
  22b80b19_26d4_cd0e_c476_3edf87b3df14["TestRequests"]
  52ca08f3_eb8b_ae91_8325_d152af372ad1 -->|defined in| 22b80b19_26d4_cd0e_c476_3edf87b3df14
  style 52ca08f3_eb8b_ae91_8325_d152af372ad1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 1369–1388

    def test_cookie_duplicate_names_different_domains(self):
        key = "some_cookie"
        value = "some_value"
        domain1 = "test1.com"
        domain2 = "test2.com"

        jar = requests.cookies.RequestsCookieJar()
        jar.set(key, value, domain=domain1)
        jar.set(key, value, domain=domain2)
        assert key in jar
        items = jar.items()
        assert len(items) == 2

        # Verify that CookieConflictError is raised if domain is not specified
        with pytest.raises(requests.cookies.CookieConflictError):
            jar.get(key)

        # Verify that CookieConflictError is not raised if domain is specified
        cookie = jar.get(key, domain=domain1)
        assert cookie == value

Domain

Subdomains

Frequently Asked Questions

What does test_cookie_duplicate_names_different_domains() do?
test_cookie_duplicate_names_different_domains() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_cookie_duplicate_names_different_domains() defined?
test_cookie_duplicate_names_different_domains() is defined in tests/test_requests.py at line 1369.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free