From 07fd138a56053033b3ced8c33d457d008b2ab2b7 Mon Sep 17 00:00:00 2001 From: bjmb Date: Tue, 4 Apr 2017 16:17:12 -0400 Subject: [PATCH 1/2] Added some more asserts to test_map_update_remove in tests --- tests/integration/cqlengine/query/test_updates.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration/cqlengine/query/test_updates.py b/tests/integration/cqlengine/query/test_updates.py index 4dc0ad12..135d826c 100644 --- a/tests/integration/cqlengine/query/test_updates.py +++ b/tests/integration/cqlengine/query/test_updates.py @@ -257,13 +257,14 @@ class QueryUpdateTests(BaseCassEngTestCase): text_map={"foo": '1', "bar": '2'} ) TestQueryUpdateModel.objects(partition=partition, cluster=cluster).update( - text_map__remove={"bar"} + text_map__remove={"bar"}, + text_map__update={"foz": '4', "foo": '2'} ) obj = TestQueryUpdateModel.objects.get(partition=partition, cluster=cluster) - self.assertEqual(obj.text_map, {"foo": '1'}) + self.assertEqual(obj.text_map, {"foo": '2', "foz": '4'}) TestQueryUpdateModel.objects(partition=partition, cluster=cluster).update( - text_map__remove={"foo"} + text_map__remove={"foo", "foz"} ) self.assertEqual( TestQueryUpdateModel.objects.get(partition=partition, cluster=cluster).text_map, From 6f16e166c38c82a6783f09285fe90ef16c0fdba7 Mon Sep 17 00:00:00 2001 From: bjmb Date: Tue, 4 Apr 2017 19:42:32 -0400 Subject: [PATCH 2/2] Skipped test test_map_update_remove if cassandra <= 2.0 --- tests/integration/cqlengine/query/test_updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/cqlengine/query/test_updates.py b/tests/integration/cqlengine/query/test_updates.py index 135d826c..7ed433c0 100644 --- a/tests/integration/cqlengine/query/test_updates.py +++ b/tests/integration/cqlengine/query/test_updates.py @@ -21,7 +21,7 @@ from cassandra.cqlengine import columns from tests.integration.cqlengine import is_prepend_reversed from tests.integration.cqlengine.base import BaseCassEngTestCase from tests.integration.cqlengine import execute_count - +from tests.integration import greaterthancass20 class TestQueryUpdateModel(Model): @@ -242,6 +242,7 @@ class QueryUpdateTests(BaseCassEngTestCase): obj = TestQueryUpdateModel.objects.get(partition=partition, cluster=cluster) self.assertEqual(obj.text_map, {"foo": '1'}) + @greaterthancass20 @execute_count(5) def test_map_update_remove(self): """