예제 #1
0
def test_csrf_token():
    assert (
        csrf_token(pretend.stub(_csrf=True, _session={"user.csrf": "123456"}))
        == "<input type=hidden name=csrf_token value=\"123456\">"
    )
예제 #2
0
def test_csrf_token():
    assert (csrf_token(
        pretend.stub(_csrf=True, _session={
            "user.csrf": "123456"
        })) == "<input type=hidden name=csrf_token value=\"123456\">")
예제 #3
0
def test_csrf_token_no_csrf(request):
    with pytest.raises(ValueError):
        csrf_token(request)
예제 #4
0
def test_csrf_token_no_csrf(request):
    with pytest.raises(ValueError):
        csrf_token(request)