test_js_example.py
This file
Path
examples/javascript/tests/test_js_example.py
27 lines · 727 bytes · Python
Last changed by
Merge remote-tracking branch 'origin/stable'David Lordbefore adoption22c48a7
History of this fileTake it
The walk stopped after 200 commits: lines older than c2688e4 point at it.
Merge pull request #5040 from pallets/dependabot/github_actions/actions/cache-3.3.1David Lordbefore adoptionc2688e4
lines 1–7why, one step back1import pytest2from flask import template_rendered345@pytest.mark.parametrize(6 ("path", "template_name"),7 (Merge remote-tracking branch 'origin/stable'David Lordbefore adoption22c48a7
line 8why, one step back8 ("/", "fetch.html"),Merge pull request #5040 from pallets/dependabot/github_actions/actions/cache-3.3.1David Lordbefore adoptionc2688e4
lines 9–27why, one step back9 ("/plain", "xhr.html"),10 ("/fetch", "fetch.html"),11 ("/jquery", "jquery.html"),12 ),13)14def test_index(app, client, path, template_name):15 def check(sender, template, context):16 assert template.name == template_name1718 with template_rendered.connected_to(check, app):19 client.get(path)202122@pytest.mark.parametrize(23 ("a", "b", "result"), ((2, 3, 5), (2.5, 3, 5.5), (2, None, 2), (2, "b", 2))24)25def test_add(client, a, b, result):26 response = client.post("/add", data={"a": a, "b": b})27 assert response.get_json()["result"] == result