Spaces:
Running
Running
File size: 517 Bytes
ebec85b 9d8008e ebec85b 1108474 ebec85b 1108474 ebec85b 1108474 ebec85b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from starlette.testclient import TestClient
from tutorial.htmx import _01_click_to_edit as module
def test_app():
client = TestClient(module.app)
def check(r):
c = module.current
assert r.status_code == 200
assert c.name in r.text
assert c.email in r.text
r = client.get("/contact")
check(r)
r = client.get("/contact/edit")
check(r)
r = client.put("/contact", data={"name": "AAA", "email": "BB"})
check(r)
assert module.current.name == "AAA"
|