tests: Ensure the error is related to the UNIQUE constraint