mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-30 22:14:22 +02:00
Update _defaults["strict"] when necessary
Refs https://github.com/simonw/sqlite-utils/pull/788#issuecomment-4948505824
This commit is contained in:
parent
7a01dd94f3
commit
5b9898ed9b
2 changed files with 15 additions and 0 deletions
|
|
@ -602,6 +602,19 @@ def test_transform_to_strict_with_invalid_data(fresh_db):
|
|||
assert fresh_db.table_names() == ["dogs"]
|
||||
|
||||
|
||||
def test_transform_strict_updates_default(fresh_db):
|
||||
if not fresh_db.supports_strict:
|
||||
pytest.skip("SQLite version does not support strict tables")
|
||||
table = fresh_db.table("items", strict=True)
|
||||
table.create({"id": int})
|
||||
|
||||
table.transform(strict=False)
|
||||
assert table.strict is False
|
||||
|
||||
table.create({"id": int}, replace=True)
|
||||
assert table.strict is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"indexes, transform_params",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue