Fix dynamodb_v2 update_item tests

Update expression has the wrong syntax. Something like :bar denotes a
placeholder which has to be filled by supplying an additional
ExpressionAttributeNames
This commit is contained in:
Victor Blaga 2016-06-21 17:46:37 +02:00
parent 69888c3baa
commit cb36a8b10f

View File

@ -435,7 +435,7 @@ def test_update_item_remove():
}
# Then remove the SentBy field
conn.update_item("messages", key_map, update_expression="REMOVE :SentBy, :SentTo")
conn.update_item("messages", key_map, update_expression="REMOVE SentBy, SentTo")
returned_item = table.get_item(username="steve")
dict(returned_item).should.equal({
@ -459,7 +459,7 @@ def test_update_item_set():
'username': {"S": "steve"}
}
conn.update_item("messages", key_map, update_expression="SET foo=:bar, blah=:baz REMOVE :SentBy")
conn.update_item("messages", key_map, update_expression="SET foo=bar, blah=baz REMOVE SentBy")
returned_item = table.get_item(username="steve")
dict(returned_item).should.equal({