From 092f5655e1efb9873ea978b2ecdaa16f840fe04c Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 29 Jul 2024 12:03:11 -0400 Subject: [PATCH] test: Change call counts with model back as default. We don't call the modulestore or update the cache here now that we are backed by the database model. Previously the cache would change because the `_encode_root_cache_key` function in `BlockStructureStore` class used the `BlockstoreBlockData.VERSION` as a part of the cache key when the data was not being cached in a DB model. --- .../djangoapps/content/block_structure/tests/test_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/content/block_structure/tests/test_manager.py b/openedx/core/djangoapps/content/block_structure/tests/test_manager.py index acde986eeee1..493e4c34714f 100644 --- a/openedx/core/djangoapps/content/block_structure/tests/test_manager.py +++ b/openedx/core/djangoapps/content/block_structure/tests/test_manager.py @@ -208,8 +208,8 @@ def test_get_collected_transformer_version(self): def test_get_collected_structure_version(self): self.collect_and_verify(expect_modulestore_called=True, expect_cache_updated=True) BlockStructureBlockData.VERSION += 1 - self.collect_and_verify(expect_modulestore_called=True, expect_cache_updated=True) - assert TestTransformer1.collect_call_count == 2 + self.collect_and_verify(expect_modulestore_called=False, expect_cache_updated=False) + assert TestTransformer1.collect_call_count == 1 def test_clear(self): self.collect_and_verify(expect_modulestore_called=True, expect_cache_updated=True)