Skip to content

Commit

Permalink
tests bugfix tst_SoftDeletes πŸ™Œ
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 4, 2024
1 parent 4823d79 commit 7f92f22
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,11 @@ void tst_SoftDeletes::restore_NotTrashed_OnTinyBuilder() const
auto [affected, query] = User::withTrashed()->whereBetween(ID, {4, 5}).restore();

QVERIFY(query.isActive() && !query.isSelect() && !query.isValid());
QCOMPARE(affected, static_cast<int>(0));
/* Longstanding bug, OK, the problem was here, sometimes can happen that
the restore() method call above isn't fast enough and this restore also
updates the updated_at column, so even if the deleted_at column isn't updated
as it's NULL (static_cast<int>(0)), so the updated_at column is updated. */
QVERIFY(affected == static_cast<int>(0) || affected == static_cast<int>(2));
}

// Validate user records in the database after the restore
Expand Down

0 comments on commit 7f92f22

Please sign in to comment.