test: move debug flag

This commit is contained in:
chenrui 2022-03-07 14:46:48 +08:00
parent ce13a2a7bc
commit 2b7a1bdcf3
1 changed files with 1 additions and 3 deletions

View File

@ -209,10 +209,8 @@ func TestJoinWithSoftDeleted(t *testing.T) {
pet := Pet{Name: "A", UserID: &user.ID}
DB.Create(&pet)
DB = DB.Debug()
var user1 User
DB.Debug().Model(&User{}).Joins("NamedPet").First(&user1, user.ID)
DB.Model(&User{}).Joins("NamedPet").First(&user1, user.ID)
AssertEqual(t, user1.ID, user.ID)
AssertEqual(t, user1.NamedPet.ID, pet.ID)