Fix bug when UPSERTing a column named 'id'

This commit is contained in:
Andrey Alekseenko
2019-02-14 22:35:47 -05:00
parent 22b64ee480
commit 25477717bc
2 changed files with 16 additions and 4 deletions
+6
View File
@@ -236,6 +236,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'