()
| 404 | def test_pch004_duplicate_output_restart(dash_duo_mp): |
| 405 | # Duplicate output ids should be the same between restarts for the same ids |
| 406 | def create_app(): |
| 407 | app = Dash(__name__) |
| 408 | app.layout = html.Div( |
| 409 | [ |
| 410 | html.Button("Click 1", id="click1"), |
| 411 | html.Button("Click 2", id="click2"), |
| 412 | html.Div(id="output"), |
| 413 | ] |
| 414 | ) |
| 415 | |
| 416 | @app.callback( |
| 417 | Output("output", "children", allow_duplicate=True), |
| 418 | Input("click1", "n_clicks"), |
| 419 | prevent_initial_call=True, |
| 420 | ) |
| 421 | def on_click(_): |
| 422 | return "click 1" |
| 423 | |
| 424 | @app.callback( |
| 425 | Output("output", "children", allow_duplicate=True), |
| 426 | Input("click2", "n_clicks"), |
| 427 | prevent_initial_call=True, |
| 428 | ) |
| 429 | def on_click(_): |
| 430 | return "click 2" |
| 431 | |
| 432 | return app |
| 433 | |
| 434 | dash_duo_mp.start_server(create_app()) |
| 435 |
no test coverage detected
searching dependent graphs…