mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-17 08:34:19 +01:00
modified tests as we do not have rollback yet. Also correctly raise a contraint error on primary keys only
This commit is contained in:
@@ -304,9 +304,8 @@ def generate_test(col_amount: int, primary_keys: int) -> ConstraintTest:
|
||||
|
||||
update_errors = []
|
||||
if len(insert_stmts) > 1:
|
||||
update_errors = [
|
||||
table.generate_update() for _ in table.columns if col.primary_key
|
||||
]
|
||||
# TODO: As we have no rollback we just generate one update statement
|
||||
update_errors = [table.generate_update()]
|
||||
|
||||
return ConstraintTest(
|
||||
table=table,
|
||||
@@ -327,7 +326,6 @@ def custom_test_1() -> ConstraintTest:
|
||||
"INSERT INTO users VALUES (2, 'bob');",
|
||||
]
|
||||
update_stmts = [
|
||||
"UPDATE users SET id = 3;",
|
||||
"UPDATE users SET id = 2, username = 'bob' WHERE id == 1;",
|
||||
]
|
||||
return ConstraintTest(
|
||||
|
||||
Reference in New Issue
Block a user