From 1016f552a0962c2a71e72e2212d3ca1051a3f53e Mon Sep 17 00:00:00 2001 From: Miha Jenko Date: Wed, 9 Jan 2019 17:59:36 +0100 Subject: [PATCH] Add test for #3515 --- tests/test_client_functional.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py index 0d490ac627f..0df3eab1226 100644 --- a/tests/test_client_functional.py +++ b/tests/test_client_functional.py @@ -1919,6 +1919,22 @@ async def handler(request): resp.close() +async def test_cookies_on_empty_session_jar(aiohttp_client) -> None: + async def handler(request): + assert 'custom-cookie' in request.cookies + assert request.cookies['custom-cookie'] == 'abc' + return web.Response() + + app = web.Application() + app.router.add_get('/', handler) + client = await aiohttp_client( + app, cookies=None) + + resp = await client.get('/', cookies={'custom-cookie': 'abc'}) + assert 200 == resp.status + resp.close() + + async def test_morsel_with_attributes(aiohttp_client) -> None: # A comment from original test: #