Пример #1
0
def test_pjax_template_auto():
    view = pjax_template()(base_view)
    resp = view(pjax_request, 'test_template.html')
    assert resp.template_name == ('test_template-pjax=secondary.html',
                                  'test_template.html')
Пример #2
0
def test_pjax_template_none_arg():
    pjax_template(None)
Пример #3
0
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                        test_template)
Пример #4
0
def test_pjax_static_template():
    view = pjax_template('static_template.html')(base_view)
    resp = view(pjax_request, test_template)
    print(resp.template_name)
    assert resp.template_name == "static_template.html"
Пример #5
0
def test_pjax_static_template():
    view = pjax_template('static_template.html')(base_view)
    resp = view(pjax_request, test_template)
    print(resp.template_name)
    assert resp.template_name == "static_template.html"
Пример #6
0
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
Пример #7
0
def test_pjax_template_auto():
    view = pjax_template()(base_view)
    resp = view(pjax_request, 'test_template.html')
    assert resp.template_name == ('test_template-pjax=secondary.html', 'test_template.html')
Пример #8
0
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)
Пример #9
0
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
Пример #10
0
def test_pjax_template_none_arg():
    pjax_template(None)
Пример #11
0
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                            test_template)
Пример #12
0
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)