Esempio n. 1
0
File: tests.py Progetto: fralud/djpj
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')
Esempio n. 2
0
File: tests.py Progetto: fralud/djpj
def test_pjax_template_none_arg():
    pjax_template(None)
Esempio n. 3
0
File: tests.py Progetto: fralud/djpj
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                        test_template)
Esempio n. 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"
Esempio n. 5
0
File: tests.py Progetto: fralud/djpj
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"
Esempio n. 6
0
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
Esempio n. 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')
Esempio n. 8
0
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)
Esempio n. 9
0
File: tests.py Progetto: aibon/djpj
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
Esempio n. 10
0
File: tests.py Progetto: aibon/djpj
def test_pjax_template_none_arg():
    pjax_template(None)
Esempio n. 11
0
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                            test_template)
Esempio n. 12
0
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)