27 lines
932 B
Python
27 lines
932 B
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
|
|
def test_galleries_have_images(anon):
|
|
for path, minimum in (("/flyers", 4), ("/memes", 10)):
|
|
html = anon.get(path).text
|
|
assert html.count("data-lightbox") >= minimum, path
|
|
|
|
|
|
def test_retired_dutch_images_are_not_listed(anon):
|
|
from molodetz.gallery import RETIRED_GALLERY
|
|
|
|
for path in ("/flyers", "/memes"):
|
|
items = anon.get(path, headers={"Accept": "application/json"}).json()["items"]
|
|
names = {item["filename"] for item in items}
|
|
assert not names & set(RETIRED_GALLERY), path
|
|
assert all(item["caption"] for item in items), path
|
|
|
|
|
|
def test_home_features_the_elite_twice_flyer(anon):
|
|
html = anon.get("/").text
|
|
assert "flyer-elite-twice.jpg" in html
|
|
assert "Elite twice." in html
|
|
counts = anon.get("/", headers={"Accept": "application/json"}).json()
|
|
assert counts["flyer_count"] == 4
|
|
assert counts["meme_count"] >= 18
|