delete debug in test

This commit is contained in:
black 2023-10-13 19:13:02 +08:00
parent 9048ea529c
commit 05f0afe324
4 changed files with 2 additions and 5 deletions

View File

@ -278,8 +278,6 @@ func TestBelongsToAssociationUnscoped(t *testing.T) {
t.Fatalf("failed to create items, got error: %v", err)
}
tx = tx.Debug()
// test replace
if err := tx.Model(&item).Association("ItemParent").Unscoped().Replace(&ItemParent{
Logo: "updated logo",

View File

@ -29,7 +29,7 @@ func TestCountWithGroup(t *testing.T) {
}
var count2 int64
if err := DB.Debug().Model(&Company{}).Where("name in ?", []string{"company_count_group_b", "company_count_group_c"}).Group("name").Count(&count2).Error; err != nil {
if err := DB.Model(&Company{}).Where("name in ?", []string{"company_count_group_b", "company_count_group_c"}).Group("name").Count(&count2).Error; err != nil {
t.Errorf(fmt.Sprintf("Count should work, but got err %v", err))
}
if count2 != 2 {

View File

@ -429,7 +429,6 @@ func TestEmbedPreload(t *testing.T) {
},
}
DB = DB.Debug()
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
actual := Org{}

View File

@ -838,7 +838,7 @@ func TestSaveWithHooks(t *testing.T) {
saveTokenOwner := func(owner *TokenOwner) (*TokenOwner, error) {
var newOwner TokenOwner
if err := DB.Transaction(func(tx *gorm.DB) error {
if err := tx.Debug().Session(&gorm.Session{FullSaveAssociations: true}).Save(owner).Error; err != nil {
if err := tx.Session(&gorm.Session{FullSaveAssociations: true}).Save(owner).Error; err != nil {
return err
}
if err := tx.Preload("Token").First(&newOwner, owner.ID).Error; err != nil {