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')
def test_pjax_template_none_arg(): pjax_template(None)
def test_pjax_template_no_result(): _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
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"
def test_pjax_template_no_result(): with pytest.raises(ValueError): _ = pjax_template(lambda *a, **kw: None)(base_view)(pjax_request, test_template)
def test_pjax_template_none_arg(): with pytest.raises(ValueError): pjax_template(None)