Skip to content

Commit 6100a19

Browse files
authored
Merge pull request #520 from meilisearch/fix-test-after-update
Fix update document test after update to v0.29
2 parents 37bf3e6 + bf974e6 commit 6100a19

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/index/test_index_document_meilisearch.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,23 @@ def test_update_documents(index_with_documents, small_movies):
9191
"""Tests updating a single document and a set of documents."""
9292
index = index_with_documents()
9393
response = index.get_documents()
94-
response.results[0].title = 'Some title'
95-
update = index.update_documents([dict(response.results[0])])
94+
doc = response.results[0]
95+
doc.title = 'Some title'
96+
97+
update = index.update_documents([dict(doc)])
98+
9699
assert isinstance(update, TaskInfo)
97100
assert update.task_uid != None
98101
index.wait_for_task(update.task_uid)
99-
response = index.get_documents()
100-
assert response.results[0].title == 'Some title'
102+
103+
response = index.get_document(doc.id)
104+
assert response.title == 'Some title'
105+
101106
update = index.update_documents(small_movies)
102107
index.wait_for_task(update.task_uid)
103-
response = index.get_documents()
104-
assert response.results[0].title != 'Some title'
108+
109+
response = index.get_document(doc.id)
110+
assert response.title != 'Some title'
105111

106112
@pytest.mark.parametrize('batch_size', [2, 3, 1000])
107113
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)