Files
Tirsvad 6562eae9ef Add the lecture step programs for URL paths, HTML, decorators and authentication
Task: MIL-002#1
Task: MIL-002#2
Task: MIL-002#3
Task: MIL-002#4
Task: MIL-002#5
2026-11-06 12:28:36 +08:00

17 lines
605 B
Python

"""Tests of lecture step 3."""
from higher_lower import constants
from higher_lower.presentation.lectures.step_03_html import create_app
def test_home_returns_centred_heading() -> None:
body = create_app().test_client().get("/").get_data(as_text=True)
assert "<h1 style='text-align: center'>Hello, World!</h1>" in body
def test_home_returns_paragraph_and_two_images() -> None:
body = create_app().test_client().get("/").get_data(as_text=True)
assert "<p>This is a paragraph.</p>" in body
assert body.count("<img ") == 2
assert f"width={constants.LECTURE_IMAGE_WIDTH}" in body