Comment cleanup
This commit is contained in:
parent
c6cbc8fe70
commit
f18276ab01
7 changed files with 336 additions and 97 deletions
|
|
@ -42,7 +42,7 @@ def test_the_navbar_and_footer_are_on_every_page():
|
|||
|
||||
@pytest.mark.django_db
|
||||
def test_the_service_cannot_reorder_the_chrome():
|
||||
"""navbar, then main, then footer — a service that wants otherwise has to
|
||||
"""navbar, then main, then footer: a service that wants otherwise has to
|
||||
stop extending the kit, which is the point."""
|
||||
html = Client().get("/privacy/").content.decode()
|
||||
assert html.index("<nav") < html.index("<main") < html.index("<footer")
|
||||
|
|
@ -94,6 +94,24 @@ def test_page_title_links_its_parent():
|
|||
assert "W-1" in html
|
||||
|
||||
|
||||
def test_page_title_walks_the_whole_trail_when_given_one():
|
||||
"""A page two levels down names its grandparent, so the trail reaches the
|
||||
section root instead of starting halfway along it."""
|
||||
html = render_to_string("yksa/ui/_page_title.html", {
|
||||
"title": "Status", "parent": "W-1", "parent_url": "/widgets/w-1/",
|
||||
"grandparent": "Widgets", "grandparent_url": "/widgets/",
|
||||
})
|
||||
assert html.index("/widgets/\"") < html.index("/widgets/w-1/")
|
||||
assert html.count("<a ") == 2
|
||||
|
||||
|
||||
def test_page_title_without_a_grandparent_is_unchanged():
|
||||
html = render_to_string("yksa/ui/_page_title.html", {
|
||||
"title": "W-1", "parent": "Widgets", "parent_url": "/widgets/",
|
||||
})
|
||||
assert html.count("<a ") == 1
|
||||
|
||||
|
||||
# --- the estate-wide rules --------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue