refactor: error translator test (#6350)

Co-authored-by: Saeid Saeidee <s.saeidee@sensysgatso.com>
This commit is contained in:
Saeid 2023-05-25 05:10:00 +02:00 committed by GitHub
parent 001738be49
commit 8197c00def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ func TestDialectorWithErrorTranslatorSupport(t *testing.T) {
db, _ := gorm.Open(tests.DummyDialector{TranslatedErr: translatedErr}) db, _ := gorm.Open(tests.DummyDialector{TranslatedErr: translatedErr})
err := db.AddError(untranslatedErr) err := db.AddError(untranslatedErr)
if errors.Is(err, translatedErr) { if !errors.Is(err, untranslatedErr) {
t.Fatalf("expected err: %v got err: %v", translatedErr, err) t.Fatalf("expected err: %v got err: %v", untranslatedErr, err)
} }
// it should translate error when the TranslateError flag is true // it should translate error when the TranslateError flag is true