From 4581e8b590a83d730dc490e8731990f467ba9e4f Mon Sep 17 00:00:00 2001 From: riverchu Date: Sun, 5 Sep 2021 23:07:28 +0800 Subject: [PATCH] test: update Save test --- tests/update_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/update_test.go b/tests/update_test.go index 869df769..2a747ce5 100644 --- a/tests/update_test.go +++ b/tests/update_test.go @@ -651,14 +651,14 @@ func TestSave(t *testing.T) { } user3.Name = "save3_" - DB.Model(User{}).Save(&user3) + DB.Model(User{Model: user3.Model}).Save(&user3) var result2 User if err := DB.First(&result2, "name = ?", "save3_").Error; err != nil || result2.ID != user3.ID { t.Fatalf("failed to find updated user") } - DB.Model(User{}).Save(&struct { + DB.Debug().Model(User{Model: user3.Model}).Save(&struct { gorm.Model Placeholder string Name string