Skip to content

Commit 73b583e

Browse files
simonwclaude
andcommitted
Simplify menu link tests now datasette>=1.0a42 is required
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent cd48e22 commit 73b583e

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎tests/test_menu_links.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import re
2-
31
import pytest
42
from datasette.app import Datasette
53

6-
# Datasette 1.0a42 added role="menuitem" to menu links
7-
APPS_LINK_RE = re.compile(r'<a href="/-/apps"[^>]*>Apps</a>')
4+
APPS_LINK = '<a href="/-/apps" role="menuitem">Apps</a>'
85

96

107
@pytest.mark.asyncio
@@ -14,7 +11,7 @@ async def test_apps_link_appears_in_datasette_menu_for_signed_in_actor():
1411
response = await datasette.client.get("/", actor={"id": "alice"})
1512

1613
assert response.status_code == 200
17-
assert APPS_LINK_RE.search(response.text)
14+
assert APPS_LINK in response.text
1815

1916

2017
@pytest.mark.asyncio
@@ -24,4 +21,4 @@ async def test_apps_link_not_shown_to_anonymous_users():
2421
response = await datasette.client.get("/")
2522

2623
assert response.status_code == 200
27-
assert not APPS_LINK_RE.search(response.text)
24+
assert APPS_LINK not in response.text

0 commit comments

Comments
 (0)