From 06abb47b953ac6852cf9c18be91af94ab9c128ca Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 14 Apr 2022 16:59:22 +0300 Subject: wqflask: Mock db connection when fetching case attributes * wqflask/tests/integration/wqflask/test_metadata_edits.py (test_show_case_attributes): Mock "database_connection". Fixes this failing test: --- wqflask/tests/integration/wqflask/test_metadata_edits.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wqflask/tests/integration/wqflask/test_metadata_edits.py b/wqflask/tests/integration/wqflask/test_metadata_edits.py index 4b9e017d..1133be40 100644 --- a/wqflask/tests/integration/wqflask/test_metadata_edits.py +++ b/wqflask/tests/integration/wqflask/test_metadata_edits.py @@ -16,8 +16,9 @@ class MetadataEditsTest(unittest.TestCase): def tearDown(self): self.app_context.pop() + @mock.patch("wqflask.metadata_edits.database_connection") @mock.patch("wqflask.metadata_edits.get_case_attributes") - def test_show_case_attributes(self, mock_case_attrs): + def test_show_case_attributes(self, mock_case_attrs, mock_conn): """Test that case attributes are displayed correctly""" mock_case_attrs.return_value = { "Condition (1)": "", -- cgit v1.2.3