From 8268724ee5bab11a30e0a08bf09c8b3aee6d0c90 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 28 Jul 2014 17:08:47 -0400 Subject: [PATCH] check 0 sends means 0 not ignore --- common/lib/xmodule/xmodule/modulestore/tests/factories.py | 4 ++-- .../xmodule/modulestore/tests/test_mixed_modulestore.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/factories.py b/common/lib/xmodule/xmodule/modulestore/tests/factories.py index bf823b0f48..2263b7f922 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/factories.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/factories.py @@ -266,7 +266,7 @@ def check_mongo_calls(mongo_store, num_finds=0, num_sends=None): """ if mongo_store.get_modulestore_type() == ModuleStoreEnum.Type.mongo: with check_exact_number_of_calls(mongo_store.collection, mongo_store.collection.find, num_finds): - if num_sends: + if num_sends is not None: with check_exact_number_of_calls( mongo_store.database.connection, mongo_store.database.connection._send_message, # pylint: disable=protected-access @@ -291,7 +291,7 @@ def check_mongo_calls(mongo_store, num_finds=0, num_sends=None): wrap_patch = patch.object(collection, 'find', find_wrap) wrap_patches.append(wrap_patch) wrap_patch.start() - if num_sends: + if num_sends is not None: connection = mongo_store.db_connection.database.connection with check_exact_number_of_calls( connection, diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py index 4813c8f032..19057f1aad 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -859,7 +859,7 @@ class TestMixedModuleStore(unittest.TestCase): self.assertEqual(len(self.store.get_courses_for_wiki('edX.simple.2012_Fall')), 0) self.assertEqual(len(self.store.get_courses_for_wiki('no_such_wiki')), 0) - @ddt.data(('draft', 2, 0), ('split', 5, 0)) + @ddt.data(('draft', 2, 6), ('split', 5, 2)) @ddt.unpack def test_unpublish(self, default_ms, max_find, max_send): """