示例#1
0
文件: tests.py 项目: 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')
示例#2
0
文件: tests.py 项目: fralud/djpj
def test_pjax_template_none_arg():
    pjax_template(None)
示例#3
0
文件: tests.py 项目: fralud/djpj
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                        test_template)
示例#4
0
文件: tests.py 项目: AlexHill/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"
示例#5
0
文件: tests.py 项目: 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"
示例#6
0
文件: tests.py 项目: AlexHill/djpj
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
示例#7
0
文件: tests.py 项目: AlexHill/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')
示例#8
0
文件: tests.py 项目: AlexHill/djpj
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)
示例#9
0
文件: tests.py 项目: aibon/djpj
def test_pjax_template_no_result():
    _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
示例#10
0
文件: tests.py 项目: aibon/djpj
def test_pjax_template_none_arg():
    pjax_template(None)
示例#11
0
文件: tests.py 项目: AlexHill/djpj
def test_pjax_template_no_result():
    with pytest.raises(ValueError):
        _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request,
                                                            test_template)
示例#12
0
文件: tests.py 项目: AlexHill/djpj
def test_pjax_template_none_arg():
    with pytest.raises(ValueError):
        pjax_template(None)