diff options
author | Daniel Lindsley <daniel@toastdriven.com> | 2013-08-08 11:51:50 -0700 |
---|---|---|
committer | Daniel Lindsley <daniel@toastdriven.com> | 2013-08-08 11:51:50 -0700 |
commit | bfa469f3ff3f36a67e22a824199dcf64a78ff263 (patch) | |
tree | 05577aef54177bfc847d7a4559dc01eacadd44ed /tests/integration/dynamodb2/test_highlevel.py | |
parent | 89793c405e7cd313c62ae771b2ecf4d465c2df70 (diff) | |
download | boto-bfa469f3ff3f36a67e22a824199dcf64a78ff263.tar.gz |
Fixed calling ``Item.partial_save`` on a new record now correctly saves.
Diffstat (limited to 'tests/integration/dynamodb2/test_highlevel.py')
-rw-r--r-- | tests/integration/dynamodb2/test_highlevel.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/integration/dynamodb2/test_highlevel.py b/tests/integration/dynamodb2/test_highlevel.py index c78e17d0..75b2e2d4 100644 --- a/tests/integration/dynamodb2/test_highlevel.py +++ b/tests/integration/dynamodb2/test_highlevel.py @@ -28,6 +28,7 @@ import time from tests.unit import unittest from boto.dynamodb2 import exceptions from boto.dynamodb2.fields import HashKey, RangeKey, KeysOnlyIndex +from boto.dynamodb2.items import Item from boto.dynamodb2.table import Table from boto.dynamodb2.types import NUMBER @@ -185,6 +186,21 @@ class DynamoDBv2Test(unittest.TestCase): jane['friend_count'] = 3 self.assertTrue(jane.save(overwrite=True)) + # Ensure that partial saves of a brand-new object work. + sadie = Item(users, data={ + 'username': 'sadie', + 'first_name': 'Sadie', + 'favorite_band': 'Zedd', + 'friend_count': 7 + }) + self.assertTrue(sadie.partial_save()) + serverside_sadie = users.get_item( + username='sadie', + friend_count=7, + consistent=True + ) + self.assertEqual(serverside_sadie['first_name'], 'Sadie') + # Test the eventually consistent query. results = users.query( username__eq='johndoe', |