Test that init_app works correctly when server=False is used. This tests the fix for https://github.com/plotly/dash/issues/3787 where using server=False and then calling init_app would result in 404 errors because the backend's server reference was not updated.
()
| 549 | |
| 550 | |
| 551 | def test_init_app_server_false_pattern(): |
| 552 | """Test that init_app works correctly when server=False is used. |
| 553 | |
| 554 | This tests the fix for https://github.com/plotly/dash/issues/3787 |
| 555 | where using server=False and then calling init_app would result in |
| 556 | 404 errors because the backend's server reference was not updated. |
| 557 | """ |
| 558 | external_server = Flask("external_test_false") |
| 559 | app = Dash(__name__, server=False) |
| 560 | |
| 561 | # Call init_app with the external server |
| 562 | app.init_app(external_server) |
| 563 | |
| 564 | # Verify both the app and backend use the external server |
| 565 | assert app.server is external_server |
| 566 | assert app.backend.server is external_server |