/-/databases and homepage maintain connection order, closes #1216

This commit is contained in:
Simon Willison 2021-06-01 20:03:07 -07:00
commit 807de378d0
4 changed files with 7 additions and 6 deletions

View file

@ -29,11 +29,11 @@ def test_homepage(app_client_two_attached_databases):
)
# Should be two attached databases
assert [
{"href": "/fixtures", "text": "fixtures"},
{"href": r"/extra%20database", "text": "extra database"},
{"href": "/fixtures", "text": "fixtures"},
] == [{"href": a["href"], "text": a.text.strip()} for a in soup.select("h2 a")]
# The first attached database should show count text and attached tables
h2 = soup.select("h2")[1]
# Database should show count text and attached tables
h2 = soup.select("h2")[0]
assert "extra database" == h2.text.strip()
counts_p, links_p = h2.find_all_next("p")[:2]
assert (