Skip to content

Commit c54ae91

Browse files
committed
Modifies test to show that DeprecationWarning is being output when LogoutButton is used in initial page layout
1 parent d6e1b58 commit c54ae91

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

components/dash-core-components/tests/integration/location/test_location_logout.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import time
66

77

8-
def test_llgo001_location_logout(dash_dcc):
8+
@pytest.mark.parametrize("add_initial_logout_button", [False, True])
9+
def test_llgo001_location_logout(dash_dcc, add_initial_logout_button):
910
app = Dash(__name__)
1011

1112
@app.server.route("/_logout", methods=["POST"])
@@ -14,9 +15,14 @@ def on_logout():
1415
rep.set_cookie("logout-cookie", "", 0)
1516
return rep
1617

17-
app.layout = html.Div(
18-
[html.H2("Logout test"), dcc.Location(id="location"), html.Div(id="content")]
19-
)
18+
layout_children = [
19+
html.H2("Logout test"),
20+
dcc.Location(id="location"),
21+
html.Div(id="content"),
22+
]
23+
if add_initial_logout_button:
24+
layout_children.append(dcc.LogoutButton())
25+
app.layout = html.Div(layout_children)
2026

2127
@app.callback(Output("content", "children"), [Input("location", "pathname")])
2228
def on_location(location_path):

0 commit comments

Comments
 (0)