mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-25 02:34:24 +02:00
Fix for upsert(hash_id=) bug, closes #84
This commit is contained in:
parent
72fa16b3d9
commit
7c28a4d133
2 changed files with 13 additions and 2 deletions
|
|
@ -28,6 +28,14 @@ def test_upsert_error_if_no_pk(fresh_db):
|
|||
table.upsert({"id": 1, "name": "Cleo"})
|
||||
|
||||
|
||||
def test_upsert_with_hash_id(fresh_db):
|
||||
table = fresh_db["table"]
|
||||
table.upsert({"foo": "bar"}, hash_id="pk")
|
||||
assert [{"pk": "a5e744d0164540d33b1d7ea616c28f2fa97e754a", "foo": "bar"}] == list(
|
||||
table.rows
|
||||
)
|
||||
|
||||
|
||||
def test_upsert_compound_primary_key(fresh_db):
|
||||
table = fresh_db["table"]
|
||||
table.upsert_all(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue