From a04e1c4c28328d358471f35733064e7605abe8b9 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Fri, 29 Nov 2024 13:32:50 +0100 Subject: [PATCH] fix test cases --- apps/dashboard_app/tests/test_dashboard_data_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dashboard_app/tests/test_dashboard_data_handler.py b/apps/dashboard_app/tests/test_dashboard_data_handler.py index 35c24132..1129408d 100644 --- a/apps/dashboard_app/tests/test_dashboard_data_handler.py +++ b/apps/dashboard_app/tests/test_dashboard_data_handler.py @@ -35,7 +35,9 @@ def mock_data_connector(): @pytest.fixture def handler(mock_data_connector): """Fixture to initialize DashboardDataHandler.""" - return DashboardDataHandler() + with patch("dashboard_app.helpers.load_data.DataConnector", return_value=mock_data_connector): + handler = DashboardDataHandler() + yield handler # Positive Scenario: Test Initialization def test_init_dashboard_data_handler(handler):