Your rating
Only visible to you. Rating only, no written review yet, so it isn't in the feed and can't be voted on.
+ +diff --git a/ato-generator-v2-test/generator.py b/ato-generator-v2-test/generator.py index b47a712..6666762 100644 --- a/ato-generator-v2-test/generator.py +++ b/ato-generator-v2-test/generator.py @@ -633,8 +633,9 @@ def page_model(ato, today, site=None, index=False, scrub_courses=True, show_cate plan = (viewer.get("plan") or "").lower() if is_member: # Signed-in members see every published card, not only the guest top 3 (DECISIONS / getSchoolView). + # Written cards only: a stars-only rating is never a public card, for guests or other members (MT t333u). top = sorted( - [rv for rv in reviews if str(rv.get("status") or "published").lower() == "published"], + guest_visible_reviews(reviews), key=lambda x: (counted_upvotes(x, day_ms(today)), str(x.get("published_at") or "")), reverse=True, ) @@ -690,7 +691,21 @@ def page_model(ato, today, site=None, index=False, scrub_courses=True, show_cate ) # No school-claim route exists yet; placeholder until that flow is built. claim_href = f"/ato/claim?slug={ato['slug']}" - form_ratings = dict(viewer.get("form_ratings") or {}) + # The signed-in author's own stars-only rating (MT t333u). It comes from the viewer's session, never from the + # public school file, and only its author sees it: their private slot to add a written review later. + # Stars stay locked and adding text uses no quota (rules.add_text_later). + own = viewer.get("own_rating") if is_member else None + own_rating = None + if own and not str(own.get("text") or "").strip(): + own_ratings = {k: int(v) for k, v in (own.get("ratings") or {}).items() if v} + rated = [own_ratings[k] for k, _, _ in CATEGORIES if own_ratings.get(k)] + own_rating = { + "stars": own.get("stars") or (round(sum(rated) / len(rated), 1) if rated else 0), + "ratings": own_ratings, + "anonymous": bool(own.get("anonymous")), + "when_label": (nice_month if own.get("anonymous") else nice_date)(own["published_at"]) if own.get("published_at") else "", + } + form_ratings = dict(own_rating["ratings"] if own_rating else (viewer.get("form_ratings") or {})) if "overall" not in form_ratings: rated = [form_ratings[k] for k, _, _ in CATEGORIES if form_ratings.get(k)] if rated: @@ -720,6 +735,7 @@ def page_model(ato, today, site=None, index=False, scrub_courses=True, show_cate "quota_left": 20 if plan in ("pro", "founding", "trial") else 5, }, "form_ratings": form_ratings, + "own_rating": own_rating, "form_text": viewer.get("form_text") or "", "form_title": viewer.get("form_title") or "", "anonymous_on": bool(viewer.get("anonymous_on")), diff --git a/ato-generator-v2-test/shared/page.css b/ato-generator-v2-test/shared/page.css index 6bcc9d9..6772ded 100644 --- a/ato-generator-v2-test/shared/page.css +++ b/ato-generator-v2-test/shared/page.css @@ -172,7 +172,6 @@ html[data-preview-view="owner"] .ob-claim-invite { display: none !important; } .ob-review .ob-ra{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:12px} .ob-review .ob-ra .ob-ract{margin:0} -.ob-form .ob-pdet{display:none} /* Vote / report buttons: reset native button chrome and draw the chevrons. */ .ob-vote{display:flex;align-items:center;gap:0;color:var(--tx2)} @@ -188,3 +187,110 @@ html[data-preview-view="owner"] .ob-claim-invite { display: none !important; } .ob-vote .ap-net{ min-width:1.4rem;text-align:center;font:600 13px/1 'General Sans',sans-serif;color:var(--tx); } + +/* ===== MOCKUP AFTER (13 Nov): page-level fixes. Same tokens; motion uses transform/opacity with cubic-bezier(.32,.72,0,1). ===== */ +/* Score shows once (hero). The line under it carries the one review count. */ +.ob-hero .ob-from{color:var(--tx2)} +.ob-hero .ob-from.is-wait{max-width:34ch;font:500 13px/18px Satoshi,sans-serif;color:var(--tx2)} + +/* Contact row (MT t329u, t331u): plain icon + label links, no boxes, the same look as About's row. + Shown in the hero below 1024px (phone + iPad); from 1024px About sits beside Bases and carries it. + Centred both ways: three equal slots capped at 148px and centred in the card, so iPad doesn't + push Call and Website out to the edges; 8px above and below the 44px row, and the facts line + directly under it starts on its own hairline, so the row sits midway between the two lines. */ +.ob-hero .ob-hcontact, +.ob-aboutc .ob-cbtn{display:grid;grid-template-columns:repeat(3,minmax(0,148px));justify-content:center;column-gap:8px;padding:8px 0;border-top:.5px solid var(--ln)} +.ob-hero .ob-hcontact{margin-top:16px} +.ob-hero .ob-hcontact+.ob-facts{margin-top:0} +.ob-aboutc .ob-cbtn{margin-top:16px} +.ob-hc{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:44px;padding:0;border:0;border-radius:0; + background:none;box-shadow:none;font:600 13px/1 'General Sans',sans-serif;color:var(--tx);text-decoration:none;white-space:nowrap; + transition:opacity .2s cubic-bezier(.32,.72,0,1)} +.ob-cbtn .ob-clink{display:flex;min-width:0;white-space:nowrap} +.ob-hc svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round} +.ob-hc:focus-visible,.ob-cbtn .ob-clink:focus-visible{outline:2px solid var(--acc);outline-offset:2px;border-radius:8px} +@media (hover:hover){a.ob-hc:hover,.ob-cbtn a.ob-clink:hover{opacity:.72}} +.ob-hc[aria-disabled="true"],.ob-cbtn .ob-clink.is-off{opacity:.38;cursor:not-allowed;pointer-events:none;text-decoration:none} +@media (max-width:1023px){ .ob-about-sec .ob-cbtn{display:none} } +@media (min-width:1024px){ .ob-hero .ob-hcontact{display:none} } +@media (prefers-reduced-motion:reduce){ .ob-hc,.ob-cbtn .ob-clink{transition:none} } + +/* Unclaimed: one clear claim step in the top card. */ +.ob-claim-step{display:flex;flex-direction:column;gap:12px;margin-top:16px;padding:16px;border-radius:16px; + background:var(--gl2);box-shadow:inset 0 0 0 .5px var(--ln)} +.ob-claim-step h2{margin:0;font:600 18px/1.2 'Clash Display',sans-serif;letter-spacing:-.02em;color:var(--tx)} +.ob-claim-step p{margin:4px 0 0;font:400 14px/20px Satoshi,sans-serif;color:var(--tx2)} +.ob-claim-btn{align-self:flex-start;min-height:44px;display:inline-flex;align-items:center;padding:0 20px;text-decoration:none} +@media (min-width:820px){ .ob-claim-step{flex-direction:row;align-items:center;justify-content:space-between} .ob-claim-btn{align-self:center;flex:none} } +html[data-preview-view="owner"] .ob-claim-step{display:none!important} +.ob-about-sec.is-empty .ob-about p.ob-gap+p.ob-gap{margin-top:2px} +/* About shares the Bases list's 16px inset, so text, hairlines and contact links start on one line in .ob-mid. */ +.ob-about-sec .ob-aboutc{padding:4px 16px} + +/* Courses: one heading with its count; groups sit in their own aligned columns. + 1 column on phones, 2 on iPad (700-1023px), 3 from 1024px, so Licences / Ratings / Other never cram. */ +.ob-cr-n{margin-left:6px;font:500 12px/16px 'JetBrains Mono',monospace;color:var(--tx2)} +.ob-crs .ob-cr-groups.is-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start} +@media (min-width:700px){ .ob-crs .ob-cr-groups.is-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 32px} } +@media (min-width:1024px){ .ob-crs .ob-cr-groups.is-grid{grid-template-columns:repeat(3,minmax(0,1fr))} } + +/* Rating card without its own score: written + rated-4.0+ beside the 5-to-1 bars. */ +.ob-ratewide.is-noscore{display:grid;grid-template-columns:minmax(0,1fr);row-gap:14px} +.ob-ratewide.is-noscore .ob-ratechips{grid-column:1;grid-row:1;margin:0;padding:0;border:0} +.ob-ratewide.is-noscore .ob-ratewide-bars{grid-column:1;grid-row:2} +@media (min-width:820px){ + .ob-ratewide.is-noscore{grid-template-columns:auto minmax(0,1fr);column-gap:40px;align-items:center} + .ob-ratewide.is-noscore .ob-ratechips{flex-direction:column;gap:10px} + .ob-ratewide.is-noscore .ob-ratewide-bars{grid-column:2;grid-row:1} +} +.ob-ratewide.is-wait .ob-wait{margin:0;font:400 14px/20px Satoshi,sans-serif;color:var(--tx2)} +.ob-rscore.is-hidden-stars:empty{display:none} +.ob-empty a{color:var(--tx);font-weight:600} + +/* Contrast: small grey text moves from the faintest grey (--tx3, ~2.5:1 on Pearl) to the secondary grey (--tx2, ~5:1). */ +.ob-gap,.ob-handle.is-none,.ob-rtext.is-none,.ob-ex,.ob-hint,.ob-cr-pill-meta,.ob-cr-detail,.ob-cr-row-meta,.ob-course-i,.ob-quota i{color:var(--tx2)} +.ob-upd{font-size:12px} + +.ob-hero .ob-from.is-zero{margin-top:14px;text-align:left;font:500 13px/18px 'JetBrains Mono',monospace} +.ob-hero .ob-claim-step+.ob-facts{margin-top:16px} + +/* Write a review (MT t331u, t332u, t341u): the seven category rows stay on the + locked v6 sequence (member/04): name with its wrapped detail in column 1, + five stars in the 110px column 2, and the live chosen-star number (or –) in + column 3, in the same 22px Clash Display tabular figures as the category + averages above. Overall's number still sits ON TOP of its five stars. + Star buttons fill the 110px column: 22x44 tap targets. */ +.ob-starcol .ob-prow .ob-pick button{width:22px;height:44px;margin:0} +.ob-starcol .ob-live{align-items:end;min-height:0;margin:0 0 16px;padding:0} +.ob-starcol .ob-live .ob-live-l{align-self:end;line-height:44px} +.ob-starcol .ob-live .ob-live-sc{grid-column:2 / 4;grid-row:1;justify-self:stretch;display:flex;flex-direction:column-reverse;align-items:flex-start;gap:0;width:auto;min-width:0;min-height:0;margin:0} +.ob-starcol .ob-live .ob-live-sc .pyr-line{height:44px;align-self:flex-start} +.ob-starcol .ob-live .ob-live-sc b.ob-live-num{align-self:flex-start;width:auto;margin:0 0 0 -1px;padding:0;text-align:left;font-variant-numeric:tabular-nums} +.ob-starcol .ob-prow b.ob-cat-num{font-variant-numeric:tabular-nums} +.ob-starcol .ob-prow:not(.is-hi):not(.is-lo) b.ob-cat-num{color:var(--tx2);filter:none} + +/* A stars-only rating is private to its author (MT t333u): one quiet card, no votes, add text later. */ +.ob-review.is-rateonly .ob-rnote{margin:8px 0 0;font:500 12px/16px Satoshi,sans-serif;color:var(--tx2)} +.ob-review.is-rateonly .ob-ra{justify-content:flex-start} +.ob-ownact.is-add{color:var(--tx);text-decoration:none;display:inline-flex;align-items:center} + +/* Long school names (over 40 characters) step down so phones don't stack 6 oversized lines. */ +.ob-idrow.is-longname .ob-name{font-size:32px;line-height:36px;letter-spacing:-.025em} +@media (min-width:700px){ .ob-idrow.is-longname .ob-name{font-size:40px;line-height:44px} } + + +/* Hero score (MT t341u): on a phone the 4.3 fills the leftover row beside the + star pyramid (root 16 + hero 20 + pyramid 80 + 12 gap, then cap at 147px so + a 390px screen is full without overflow). On iPad it steps up from the locked + 88px to 120px. Hidden-rating dashes stay at 56px. Desktop from 1024px stays 88px. */ +@media (max-width:819px){ + .ob-hero .ob-rate{gap:12px} + .ob-hero .ob-big:not(.is-none){font-size:clamp(96px,calc((100vw - 164px) / 1.54),147px);line-height:.76;min-width:0} +} +@media (min-width:820px) and (max-width:1023px){ + .ob-hero .ob-big:not(.is-none){font-size:120px;line-height:.76} +} + +/* ===== OPTION A — hero-first ===== */ +.ob-hero .ob-claim-step{margin-top:14px} +.ob-crscard.ob-card.va-card{border-radius:24px;background:var(--gl);box-shadow:inset 0 1px 0 var(--hl),inset 0 0 0 .5px var(--ln),var(--sh);padding:16px} diff --git a/ato-generator-v2-test/shared/page.js b/ato-generator-v2-test/shared/page.js index ad9e2ea..103c327 100644 --- a/ato-generator-v2-test/shared/page.js +++ b/ato-generator-v2-test/shared/page.js @@ -53,4 +53,110 @@ }); }); + + /* MOCKUP AFTER: replies open (was only in static/ato-guest.js, which no page loads). Transform/opacity only. */ + ready(function () { + var E = "cubic-bezier(.32,.72,0,1)", RM = window.matchMedia("(prefers-reduced-motion: reduce)").matches; + document.addEventListener("click", function (e) { + var btn = e.target.closest(".ob-ttg"); + if (!btn) return; + var th = btn.closest(".ob-thread"), body = th && th.querySelector(".ob-tbody"); + if (!body) return; + var open = btn.getAttribute("aria-expanded") !== "true"; + th.classList.toggle("is-open", open); + btn.setAttribute("aria-expanded", String(open)); + body.hidden = !open; + if (open && !RM && body.animate) body.animate([{ opacity: 0, transform: "translateY(-8px)" }, { opacity: 1, transform: "none" }], { duration: 300, easing: E }); + }); + /* Current / Expired correction between nightly builds (SAST date). */ + var d = new Date(Date.now() + 72e5).toISOString().slice(0, 10); + [].forEach.call(document.querySelectorAll(".ob-st[data-until]"), function (p) { + var cur = p.dataset.until >= d, b = p.nextElementSibling; + if (p.classList.contains("ob-cur") === cur) return; + p.classList.toggle("ob-cur", cur); p.classList.toggle("ob-exp", !cur); p.textContent = cur ? "Current" : "Expired"; + if (b) { b.className = cur ? "ok" : "exp"; b.textContent = b.textContent.replace(/^(Until|Ended)/, cur ? "Until" : "Ended"); } + }); + }); + + + /* Write-form stars: live category number (or –) and overall, click + keyboard. */ + ready(function () { + function setStarGroup(group, n) { + var btns = group.querySelectorAll("button[data-s]"); + btns.forEach(function (b) { + var k = +b.getAttribute("data-s"); + b.classList.toggle("on", k <= n); + b.setAttribute("aria-checked", k === n ? "true" : "false"); + b.tabIndex = (n ? k === n : k === 1) ? 0 : -1; + }); + } + function setCatNum(row, n) { + var num = row && row.querySelector(".ob-cat-num"); + if (!num) return; + num.textContent = n ? n.toFixed(1) : "–"; + num.classList.toggle("is-sweep", n >= 4); + num.classList.toggle("is-lo", n > 0 && n < 4); + } + function liveOverall(form) { + var vals = []; + form.querySelectorAll(".ob-prow").forEach(function (row) { + var on = row.querySelectorAll(".ob-pick button.on"); + if (on.length) vals.push(on.length); + }); + var box = form.querySelector(".ob-live"); + var num = form.querySelector(".ob-live-num"); + if (!box || !num) return; + if (!vals.length) { + box.classList.remove("is-hi", "is-lo"); + num.textContent = "–"; + num.classList.remove("is-sweep"); + return; + } + var avg = Math.round((vals.reduce(function (a, b) { return a + b; }, 0) / vals.length) * 10) / 10; + box.classList.toggle("is-hi", avg >= 4); + box.classList.toggle("is-lo", avg < 4); + num.textContent = avg.toFixed(1); + num.classList.toggle("is-sweep", avg >= 4); + } + function applyRow(row, n) { + var group = row.querySelector(".ob-pick"); + if (!group) return; + setStarGroup(group, n); + row.classList.toggle("is-hi", n >= 4); + row.classList.toggle("is-lo", n > 0 && n < 4); + setCatNum(row, n); + var form = row.closest(".ob-form"); + if (form) liveOverall(form); + } + document.querySelectorAll(".ob-form .ob-prow .ob-pick").forEach(function (group) { + var checked = group.querySelector("button[data-s][aria-checked=true]"); + var first = group.querySelector("button[data-s]"); + group.querySelectorAll("button[data-s]").forEach(function (b) { + b.tabIndex = (checked ? b === checked : b === first) ? 0 : -1; + }); + }); + document.addEventListener("click", function (e) { + var star = e.target.closest(".ob-form .ob-pick button[data-s]"); + if (!star || star.disabled) return; + applyRow(star.closest(".ob-prow"), +star.getAttribute("data-s")); + }); + document.addEventListener("keydown", function (e) { + var star = e.target.closest(".ob-form .ob-pick button[data-s]"); + if (!star || star.disabled) return; + var keys = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1, Home: "min", End: "max" }; + var move = keys[e.key]; + if (move == null) return; + e.preventDefault(); + var group = star.parentNode; + var btns = [].slice.call(group.querySelectorAll("button[data-s]")); + var n; + if (move === "min") n = 1; + else if (move === "max") n = 5; + else n = Math.max(1, Math.min(5, +star.getAttribute("data-s") + move)); + applyRow(star.closest(".ob-prow"), n); + var next = group.querySelector('button[data-s="' + n + '"]'); + if (next) next.focus(); + }); + }); + })(); diff --git a/ato-generator-v2-test/template/ato.html.j2 b/ato-generator-v2-test/template/ato.html.j2 index edc9230..d29d0ac 100644 --- a/ato-generator-v2-test/template/ato.html.j2 +++ b/ato-generator-v2-test/template/ato.html.j2 @@ -51,16 +51,13 @@ H.setAttribute("data-preview-view",Q.get("view")==="owner"?"owner":"member");
{{ ato.about }}
- {% else %}This school hasn't added a description yet.
{% endif %} - {% if missing_contact %}No contact details yet.
{% endif %} + {% else %}Nothing added yet.
{% endif %} + {% if missing_contact %}No contact details listed yet.
{% endif %}Courses not listed on the SACAA record.
+Courses not listed on the SACAA record yet.
{% else %} -{% if b0.name and b0.town and b0.town != b0.name %}{{ b0.name }} · {{ b0.town }}{% elif b0.name %}{{ b0.name }}{% elif b0.town %}{{ b0.town }}{% endif %}
{% endif %}{{ ato.handle }}.official
{% else %}Not claimed by the school yet
{% endif %} + {% if ato.rating.count %}{{ score }} from {{ ato.rating.count }} reviews
{% endif %} -{% set nc = certificate_count %}{{ nc }} {{ 'certificate' if nc == 1 else 'certificates' }} · {{ ato.bases|length }} {{ 'base' if ato.bases|length == 1 else 'bases' }} · {{ ato.rating.count }} {{ 'review' if ato.rating.count == 1 else 'reviews' }}{% if not rating_shown %} · rating shows at {{ min_reviews }}{% endif %}
+ {% endif %} + {% if rating_shown %}from {{ ato.rating.count }} reviews
+ {% elif ato.rating.count %}{{ ato.rating.count }} of {{ min_reviews }} reviews needed for a rating
+ {% else %}No reviews yet
{% endif %} + {% set c = ato.contact or {} %} + {#- Unclaimed with no contact at all: the claim step already says pilots can't contact the school, so no dead row. -#} + {% if verified or c.phone or c.email or c.web %} +Claim this page to add your phone, email, website, about text and courses. Until then, pilots can't contact you from here.
{% set nc = certificate_count %}{{ nc }} {{ 'certificate' if nc == 1 else 'certificates' }} · {{ ato.bases|length }} {{ 'base' if ato.bases|length == 1 else 'bases' }}
Rate any of seven, skip the rest
+ {% if adding %} +Your stars are posted and stay locked. Add your written review below; it joins the feed and can be voted on once posted.
+ {% else %} +Rate any of 7, skip the rest. Written review optional: post stars now, add text later. Stars-only ratings stay private to you, with no feed card and no votes.
+ {% endif %}Adding text to your rating uses no review from your quota
+ + {% else %}0 of {{ can.quota }} reviews used this cycle
- + + {% endif %}Most helpful
No reviews yet. Sign up to review.
+No reviews yet. Sign in free to write the first one.
{% endif %}from 9 reviews
' in html # review count once, in the hero, not as a chip + assert '2 certificates · 2 bases
' in html # certificates counted once, in the hero def test_a_summary_that_does_not_add_up_stops_the_build(): @@ -91,8 +94,11 @@ def test_sast_date_does_not_lag_behind_utc(): def test_rating_stays_hidden_when_the_server_says_so_even_with_enough_reviews(tmp_path): a = copy.deepcopy(PAID); a["rating"] = {"shown": False, "count": 5, "written": 5} # e.g. two of the accounts are 3 days old h = render(tmp_path, a) - assert 'data-rating-kind="empty"' in h and 'class="ob-from"' not in h - assert re.findall(r'([^<]+)', card(h)) == ["5", "5", "–", "2"] # no "Rated 4.0+" number either + assert 'data-rating-kind="empty"' in h and 'data-v=""' in h and ">–" in h + assert 'from' not in h # no scored "from N reviews" + assert '
5 of 3 reviews needed for a rating
' in h + assert "ob-ratechip" not in h and "Rated 4.0+" not in h # no 4.0+ number while hidden + assert "Stars and the 5-to-1 breakdown appear at 3 reviews." in h assert "application/ld+json" not in h assert rating.summarise([{"stars": {"org": 5}, "text": "x", "account_created": d} for d in ("2026-01-01", "2026-01-01", "2026-11-06")], TODAY)["shown"] is False @@ -135,7 +141,9 @@ def test_bad_contact_values_are_left_out_and_never_become_links(tmp_path): assert sum("left out" in w for w in warn) == 3 h = render(tmp_path, a) assert 'href="#"' not in h and "javascript:" not in h and "onclick" not in h - assert h.count('') == 3 # same pill, not a dead link + assert h.count('') == 3 # about row: same pill, not a dead link + assert h.count('') == 3 # hero row: same buttons, not a dead link + assert 'Licences.*?', h, re.S).group(0) - rat = re.search(r'No reviews yet
' in h # no invented reviews or rating (REV-022) + assert 'data-rating-kind="glass"' not in h and 'data-rating-kind="flat"' not in h + assert "from 0 reviews" not in h # a second run with a smaller master leaves no stale school behind m = master(); m["schools"] = m["schools"][:1]; src.write_text(json.dumps(m)) generator.main(["--master", str(src), "--out", str(tmp_path / "build"), "--today", "2026-11-09"]) diff --git a/ato-generator-v2-test/tests/test_rules.py b/ato-generator-v2-test/tests/test_rules.py index bd9df50..6191696 100644 --- a/ato-generator-v2-test/tests/test_rules.py +++ b/ato-generator-v2-test/tests/test_rules.py @@ -48,7 +48,8 @@ def test_rating_hidden_under_3_reviews(pages): h = hero(pages["example-air-school"]) # 2 reviews assert 'data-rating-kind="empty"' in h and 'data-v=""' in h and ">–" in h assert "filter-glass" not in h and "out of 5 stars" not in h - assert "rating shows at 3" in h + assert "2 of 3 reviews needed for a rating" in h + assert "from 2 reviews" not in h @pytest.mark.parametrize("score,gold,kind", [("4.3", True, "glass"), ("4.0", True, "glass"), @@ -66,36 +67,20 @@ def test_shiny_page_has_sweep(pages): assert 'data-rating-kind="glass"' in h and "is-sweep" in h and "filter-glass" in h -def _nrate(html): - start = html.find('class="ob-nrate') - assert start != -1 - start = html.rfind("4.3 from 9 reviews' in h - assert 'data-rating-kind="glass"' in h + assert "ob-nrate" not in h + assert 'data-rating-kind="glass"' in h and "is-sweep" in h and "filter-glass" in h + assert "pyr" in h and h.find('data-rating-kind="glass"') < h.find('class="ob-big is-sweep"') + assert '4.3' in h + assert 'from 9 reviews
' in h + assert "4.3" not in h # score is not repeated on the from-line + unrated = hero(pages["example-air-school"]) + assert "ob-nrate" not in unrated + assert 'data-rating-kind="empty"' in unrated and "pyr" in unrated + assert '–' in unrated + assert '2 of 3 reviews needed for a rating
' in unrated def test_seven_categories_in_order(pages): @@ -138,9 +123,10 @@ def test_no_viewer_data_in_static_page(pages): def test_count_beside_number_and_cert_updated(pages): h = pages["example-flight-academy"] - assert '4.3 from 9 reviews
' in h + assert 'from 9 reviews
' in h assert "Updated 1 Nov 2026" in h - assert 'class="ob-from"' not in pages["example-air-school"] # under 3 reviews: no score, no "from N" + assert 'from' not in pages["example-air-school"] # under 3 reviews: no scored "from N" + assert '
2 of 3 reviews needed for a rating
' in pages["example-air-school"] def test_edited_tag(pages):