def METHOD_NAME(self):
    connection = mock.MagicMock()
    connection.database_resources = [database_resource("Data Store", "sqlite:///db.sqlite", filterable=True)]
    project = mock.MagicMock()
    project.find_connection.return_value = connection
    def online_filters(resource_label, resource_type):
        return {SCENARIO_FILTER_TYPE: {}, TOOL_FILTER_TYPE: {}}[resource_type]
    connection.online_filters.side_effect = online_filters
    connection.get_scenario_names.return_value = ["my_scenario"]
    connection.get_tool_names.return_value = ["my_tool"]
    connection.is_filter_online_by_default = True
    with resource_filter_model(connection, project, self._undo_stack, self._logger) as model:
        connection.resource_filter_model = model
        model.build_tree()
        root_index = model.index(0, 0)
        self.assertEqual(model.rowCount(root_index), 2)
        scenario_root_index = model.index(0, 0, root_index)
        self.assertEqual(model.rowCount(scenario_root_index), 2)
        my_scenario_index = model.index(1, 0, scenario_root_index)
        self.assertEqual(my_scenario_index.data(), "my_scenario")
        self.assertEqual(model.data(my_scenario_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Checked.value)
        self.assertTrue(
            model.setData(my_scenario_index, Qt.CheckState.Unchecked.value, Qt.ItemDataRole.CheckStateRole)
        )
        self.assertEqual(
            model.data(my_scenario_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Unchecked.value
        )
        self.assertTrue(
            model.setData(my_scenario_index, Qt.CheckState.Checked.value, Qt.ItemDataRole.CheckStateRole)
        )
        self.assertEqual(model.data(my_scenario_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Checked.value)
        tool_root_index = model.index(1, 0, root_index)
        self.assertEqual(model.rowCount(tool_root_index), 2)
        my_tool_index = model.index(1, 0, tool_root_index)
        self.assertEqual(my_tool_index.data(), "my_tool")
        self.assertEqual(model.data(my_tool_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Checked.value)
        self.assertTrue(model.setData(my_tool_index, Qt.CheckState.Unchecked.value, Qt.ItemDataRole.CheckStateRole))
        self.assertEqual(model.data(my_tool_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Unchecked.value)
        self.assertTrue(model.setData(my_tool_index, Qt.CheckState.Checked.value, Qt.ItemDataRole.CheckStateRole))
        self.assertEqual(model.data(my_tool_index, Qt.ItemDataRole.CheckStateRole), Qt.CheckState.Checked.value)