Updates the prepend to list test to make sure order is preserved when
multiple items are prepended
This commit is contained in:
@@ -173,12 +173,13 @@ class QueryUpdateTests(BaseCassEngTestCase):
|
|||||||
self.assertEqual(obj.text_list, ["foo", "bar"])
|
self.assertEqual(obj.text_list, ["foo", "bar"])
|
||||||
|
|
||||||
def test_list_prepend_updates(self):
|
def test_list_prepend_updates(self):
|
||||||
|
""" Prepend two things since order is reversed by default by CQL """
|
||||||
partition = uuid4()
|
partition = uuid4()
|
||||||
cluster = 1
|
cluster = 1
|
||||||
TestQueryUpdateModel.objects.create(
|
TestQueryUpdateModel.objects.create(
|
||||||
partition=partition, cluster=cluster, text_list=["foo"])
|
partition=partition, cluster=cluster, text_list=["foo"])
|
||||||
TestQueryUpdateModel.objects(
|
TestQueryUpdateModel.objects(
|
||||||
partition=partition, cluster=cluster).update(
|
partition=partition, cluster=cluster).update(
|
||||||
text_list__prepend=['bar'])
|
text_list__prepend=['bar', 'baz'])
|
||||||
obj = TestQueryUpdateModel.objects.get(partition=partition, cluster=cluster)
|
obj = TestQueryUpdateModel.objects.get(partition=partition, cluster=cluster)
|
||||||
self.assertEqual(obj.text_list, ["bar", "foo"])
|
self.assertEqual(obj.text_list, ["bar", "baz", "foo"])
|
||||||
|
|||||||
Reference in New Issue
Block a user