diff --git a/integrations/mongodb_atlas/tests/test_fulltext_retrieval.py b/integrations/mongodb_atlas/tests/test_fulltext_retrieval.py index 23c76cb69..239c03959 100644 --- a/integrations/mongodb_atlas/tests/test_fulltext_retrieval.py +++ b/integrations/mongodb_atlas/tests/test_fulltext_retrieval.py @@ -5,6 +5,7 @@ from typing import List, Union from unittest.mock import MagicMock +from haystack import Document import pytest from haystack_integrations.document_stores.mongodb_atlas import MongoDBAtlasDocumentStore @@ -26,6 +27,18 @@ def document_store(self) -> MongoDBAtlasDocumentStore: full_text_search_index="full_text_index", ) + @pytest.fixture(autouse=True) + def setup_teardown(self, document_store): + document_store.collection.delete_many({}) + document_store.write_documents([ + Document(content="The quick brown fox chased the dog", meta={"meta_field": "right_value"}), + Document(content="The fox was brown", meta={"meta_field": "right_value"}), + Document(content="The lazy dog"), + Document(content="fox fox fox"), + ]) + + yield + def test_pipeline_correctly_passes_parameters(self, document_store: MongoDBAtlasDocumentStore): mock_collection = MagicMock() document_store._collection = mock_collection