Merge pull request #1334 from reinecke/fix/dynamo_projection_mutation

dynamodb2: Fix for ProjectionExpressions changing the data in storage
This commit is contained in:
Jack Danger 2017-11-12 08:05:33 -08:00 committed by GitHub
commit 068417b1f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -367,10 +367,21 @@ def test_basic_projection_expressions():
)
assert 'body' in results['Items'][0]
assert 'subject' not in results['Items'][0]
assert results['Items'][0]['body'] == 'some test message'
assert 'body' in results['Items'][1]
assert 'subject' not in results['Items'][1]
assert results['Items'][1]['body'] == 'yet another test message'
# The projection expression should not remove data from storage
results = table.query(
KeyConditionExpression=Key('forum_name').eq(
'the-key'),
)
assert 'subject' in results['Items'][0]
assert 'body' in results['Items'][1]
assert 'forum_name' in results['Items'][1]
@mock_dynamodb2
def test_basic_projection_expressions_with_attr_expression_names():