From e5971e3e0ad13e1c1efc41912e74288cad0fe325 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Mon, 14 Jan 2019 14:04:04 +0200 Subject: [PATCH] [3.5] Add test for #3515 (#3517) (#3534) (cherry picked from commit aa5cccb) Co-authored-by: Miha Jenko --- 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: #