Sample app for testing config deploy_url is correct (in tests).
()
| 13 | |
| 14 | |
| 15 | def DeployUrlSample() -> None: |
| 16 | """Sample app for testing config deploy_url is correct (in tests).""" |
| 17 | import reflex as rx |
| 18 | |
| 19 | class State(rx.State): |
| 20 | @rx.event |
| 21 | def goto_self(self): |
| 22 | if (deploy_url := rx.config.get_config().deploy_url) is not None: |
| 23 | return rx.redirect(deploy_url) |
| 24 | return None |
| 25 | |
| 26 | def index(): |
| 27 | return rx.fragment( |
| 28 | rx.button("GOTO SELF", on_click=State.goto_self, id="goto_self") |
| 29 | ) |
| 30 | |
| 31 | app = rx.App() |
| 32 | app.add_page(index) |
| 33 | |
| 34 | |
| 35 | @pytest.fixture(scope="module") |