mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-21 15:13:55 +02:00
Added redirection callbacks to the person and the company page. (#423)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user