Skip to content

Commit

Permalink
Include duplicate error message in error assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Jul 18, 2023
1 parent 4467f16 commit 4c07d3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/horizon/internal/db2/history/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ func TestInsertTransactionDoesNotAllowDuplicateIndex(t *testing.T) {
tt.Assert.NoError(q.Begin())
insertBuilder = q.NewTransactionBatchInsertBuilder()
tt.Assert.NoError(insertBuilder.Add(secondTransaction, sequence))
tt.Assert.Error(insertBuilder.Exec(tt.Ctx, q))
tt.Assert.EqualError(
insertBuilder.Exec(tt.Ctx, q),
"pq: duplicate key value violates unique constraint \"hs_transaction_by_id\"",
)
tt.Assert.NoError(q.Rollback())

ledger := Ledger{
Expand Down

0 comments on commit 4c07d3b

Please sign in to comment.