📝 Update template docs with more info about url_for (#5937)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Ezzeddin Abdullah
2024-01-12 00:25:37 +02:00
committed by GitHub
parent 22e68b151d
commit 0c796747a3
3 changed files with 49 additions and 6 deletions

View File

@@ -16,7 +16,10 @@ def test_main():
client = TestClient(app)
response = client.get("/items/foo")
assert response.status_code == 200, response.text
assert b"<h1>Item ID: foo</h1>" in response.content
assert (
b'<h1><a href="http://testserver/items/foo">Item ID: foo</a></h1>'
in response.content
)
response = client.get("/static/styles.css")
assert response.status_code == 200, response.text
assert b"color: green;" in response.content