modified tests as we do not have rollback yet. Also correctly raise a contraint error on primary keys only

This commit is contained in:
pedrocarlo 2025-04-30 14:26:50 -03:00
parent 3aaf4206b7
commit 758dfff2fe
2 changed files with 113 additions and 21 deletions

View file

@ -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(