mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-10 10:34:10 +02:00
Fix bug with upsert_all() and single column tables, closes #271
This commit is contained in:
parent
b0f9d1e494
commit
b9629099ab
3 changed files with 29 additions and 13 deletions
|
|
@ -991,6 +991,13 @@ def test_insert_all_empty_list(fresh_db):
|
|||
assert 1 == fresh_db["t"].count
|
||||
|
||||
|
||||
def test_insert_all_single_column(fresh_db):
|
||||
table = fresh_db["table"]
|
||||
table.insert_all([{"name": "Cleo"}], pk="name")
|
||||
assert [{"name": "Cleo"}] == list(table.rows)
|
||||
assert table.pks == ["name"]
|
||||
|
||||
|
||||
def test_create_with_a_null_column(fresh_db):
|
||||
record = {"name": "Name", "description": None}
|
||||
fresh_db["t"].insert(record)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue