From df581f7427d6694a8212e2c776ec7239d8983e73 Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Fri, 13 Dec 2024 11:11:32 +0530 Subject: [PATCH] test: fix restore block test case --- .../core/djangoapps/content/search/tests/test_handlers.py | 8 +++++++- openedx/core/djangoapps/content_tagging/handlers.py | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openedx/core/djangoapps/content/search/tests/test_handlers.py b/openedx/core/djangoapps/content/search/tests/test_handlers.py index 097a79eae6a..dc274d18269 100644 --- a/openedx/core/djangoapps/content/search/tests/test_handlers.py +++ b/openedx/core/djangoapps/content/search/tests/test_handlers.py @@ -188,4 +188,10 @@ def test_create_delete_library_block(self, meilisearch_client): # Restore the Library Block library_api.restore_library_block(problem.usage_key) - meilisearch_client.return_value.index.return_value.update_documents.assert_called_with([doc_problem]) + meilisearch_client.return_value.index.return_value.update_documents.assert_any_call([doc_problem]) + meilisearch_client.return_value.index.return_value.update_documents.assert_any_call( + [{'id': doc_problem['id'], 'collections': {'display_name': [], 'key': []}}] + ) + meilisearch_client.return_value.index.return_value.update_documents.assert_any_call( + [{'id': doc_problem['id'], 'tags': {}}] + ) diff --git a/openedx/core/djangoapps/content_tagging/handlers.py b/openedx/core/djangoapps/content_tagging/handlers.py index 6aa77b5ccd8..86cbb7167cb 100644 --- a/openedx/core/djangoapps/content_tagging/handlers.py +++ b/openedx/core/djangoapps/content_tagging/handlers.py @@ -20,7 +20,6 @@ XBLOCK_DUPLICATED, LIBRARY_BLOCK_CREATED, LIBRARY_BLOCK_UPDATED, - LIBRARY_BLOCK_DELETED, ) from .api import copy_object_tags @@ -30,7 +29,6 @@ update_course_tags, update_xblock_tags, update_library_block_tags, - delete_library_block_tags, ) from .toggles import CONTENT_TAGGING_AUTO