From 8c116e8bc71c88d0a07c7091e9a54d2f003a3bfe Mon Sep 17 00:00:00 2001 From: Denis Belavin Date: Fri, 5 Feb 2021 14:36:34 +0300 Subject: [PATCH] Add test for issue: #998 --- tests/test_sessions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_sessions.py b/tests/test_sessions.py index ea22a1ad87..f52c477c2e 100644 --- a/tests/test_sessions.py +++ b/tests/test_sessions.py @@ -345,6 +345,15 @@ def test_expired_cookies(self, httpbin): assert 'cookie1' in updated_session['cookies'] assert 'cookie2' not in updated_session['cookies'] + def test_get_expired_cookies_using_max_age(self): + headers = [ + ('Set-Cookie', 'one=two; Max-Age=0; path=/; domain=.tumblr.com; HttpOnly') + ] + expected_expired = [ + {'name': 'one', 'path': '/'} + ] + assert get_expired_cookies(headers, now=None) == expected_expired + @pytest.mark.parametrize( argnames=['headers', 'now', 'expected_expired'], argvalues=[