Merge pull request #284 from al42and/upsert_id

Fix bug when UPSERTing a column named 'id'
This commit is contained in:
Friedrich Lindenberg
2019-07-13 14:28:32 +02:00
committed by GitHub
2 changed files with 16 additions and 4 deletions
+6
View File
@@ -232,6 +232,12 @@ class TableTestCase(unittest.TestCase):
)
assert len(self.tbl) == len(TEST_DATA) + 1, len(self.tbl)
def test_upsert_id(self):
table = self.db['banana_with_id']
data = dict(id=10, title='I am a banana!')
table.upsert(data, ['id'])
assert len(table) == 1, len(table)
def test_update_while_iter(self):
for row in self.tbl:
row['foo'] = 'bar'