Added redirection callbacks to the person and the company page. (#423)

This commit is contained in:
2023-12-04 19:11:22 +01:00
committed by GitHub
parent 92d14b5824
commit 319ca3b8ad
6 changed files with 76 additions and 40 deletions

View File

@ -213,13 +213,13 @@ def test_layout() -> None:
@pytest.mark.parametrize("empty", ["", None, {}])
def test_redirect_empty(empty: Any) -> None:
"""Tests the redirection on clicking on the plot with an empty argument."""
assert home.redirect(empty) == dash.no_update # type: ignore
assert home.redirect_from_home_graph(empty) == dash.no_update # type: ignore
def test_redirect_content_without_db() -> None:
"""Tests the error when no SQL session is defined."""
with pytest.raises(ValueError, match="No SQL session defined."):
assert home.redirect({"empty": ""})
assert home.redirect_from_home_graph({"empty": ""})
@pytest.mark.usefixtures("_set_session")
@ -236,4 +236,4 @@ def test_redirect_content_without_db() -> None:
)
def test_redirect(click_on: dict, redirect_to: Any) -> None:
"""Tests the redirection when clicking on a plot."""
assert home.redirect({"points": [click_on]}) == redirect_to
assert home.redirect_from_home_graph({"points": [click_on]}) == redirect_to