Skip to content

Commit

Permalink
Fix tests I broke in #2302
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Mar 13, 2024
1 parent 9cc6f19 commit feddd61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datasette/templates/patterns.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li><a href="/-/plugins">Installed plugins</a></li>
<li><a href="/-/versions">Version info</a></li>
</ul>
<form action="/-/logout" method="post">
<form class="nav-menu-logout" action="/-/logout" method="post">
<button class="button-as-link">Log out</button>
</form>
</div>
Expand Down
7 changes: 5 additions & 2 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def test_logout_button_in_navigation(ds_client, path):
anon_response = await ds_client.get(path)
for fragment in (
"<strong>test</strong>",
'<form action="/-/logout" method="post">',
'<form class="nav-menu-logout" action="/-/logout" method="post">',
):
assert fragment in response.text
assert fragment not in anon_response.text
Expand All @@ -121,7 +121,10 @@ async def test_logout_button_in_navigation(ds_client, path):
async def test_no_logout_button_in_navigation_if_no_ds_actor_cookie(ds_client, path):
response = await ds_client.get(path + "?_bot=1")
assert "<strong>bot</strong>" in response.text
assert '<form action="/-/logout" method="post">' not in response.text
assert (
'<form class="nav-menu-logout" action="/-/logout" method="post">'
not in response.text
)


@pytest.mark.parametrize(
Expand Down

0 comments on commit feddd61

Please sign in to comment.