Exemple #1
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add('Set-Cookie', 'a=2; Path=/')
    res.headers.add('Set-Cookie', 'b=3; Path=/')
    res.unset_cookie('a')
    assert res.headers.getall('Set-Cookie') == ['b=3; Path=/']
    res.unset_cookie(text_('b'))
    assert res.headers.getall('Set-Cookie') == []
Exemple #2
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add("Set-Cookie", "a=2; Path=/")
    res.headers.add("Set-Cookie", "b=3; Path=/")
    res.unset_cookie("a")
    assert res.headers.getall("Set-Cookie") == ["b=3; Path=/"]
    res.unset_cookie(text_("b"))
    assert res.headers.getall("Set-Cookie") == []
Exemple #3
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add('Set-Cookie', 'a=2; Path=/')
    res.headers.add('Set-Cookie', 'b=3; Path=/')
    res.unset_cookie('a')
    eq_(res.headers.getall('Set-Cookie'), ['b=3; Path=/'])
    res.unset_cookie(text_('b'))
    eq_(res.headers.getall('Set-Cookie'), [])
Exemple #4
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add('Set-Cookie', 'a=2; Path=/')
    res.headers.add('Set-Cookie', 'b=3; Path=/')
    res.unset_cookie('a')
    eq_(res.headers.getall('Set-Cookie'), ['b=3; Path=/'])
    res.unset_cookie(text_('b'))
    eq_(res.headers.getall('Set-Cookie'), [])
Exemple #5
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add("Set-Cookie", "a=2; Path=/")
    res.headers.add("Set-Cookie", "b=3; Path=/")
    res.unset_cookie("a")
    assert res.headers.getall("Set-Cookie") == ["b=3; Path=/"]
    res.unset_cookie(text_("b"))
    assert res.headers.getall("Set-Cookie") == []
Exemple #6
0
def test_unset_cookie_key_in_cookies():
    res = Response()
    res.headers.add("Set-Cookie", "a=2; Path=/")
    res.headers.add("Set-Cookie", "b=3; Path=/")
    res.unset_cookie("a")
    eq_(res.headers.getall("Set-Cookie"), ["b=3; Path=/"])
    res.unset_cookie(text_("b"))
    eq_(res.headers.getall("Set-Cookie"), [])
Exemple #7
0
def test_unset_cookie_not_existing_and_strict():
    res = Response()
    with pytest.raises(KeyError):
        res.unset_cookie('a')
Exemple #8
0
def test_unset_cookie_not_existing_and_not_strict():
    res = Response()
    res.unset_cookie('a', strict=False) # no exception