Skip to content

Commit 8a144c5

Browse files
Merge pull request #58 from oracle-samples/association-test
Fixing TestUpdateHasManyAssociations
2 parents 32ceaf5 + 46502b9 commit 8a144c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/update_has_many_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import (
4444
. "github.com/oracle-samples/gorm-oracle/tests/utils"
4545

4646
"gorm.io/gorm"
47+
"gorm.io/gorm/clause"
4748
)
4849

4950
func TestUpdateHasManyAssociations(t *testing.T) {
50-
t.Skip()
5151
user := *GetUser("update-has-many", Config{})
5252

5353
if err := DB.Create(&user).Error; err != nil {
@@ -67,7 +67,7 @@ func TestUpdateHasManyAssociations(t *testing.T) {
6767
pet.Name += "new"
6868
}
6969

70-
if err := DB.Save(&user).Error; err != nil {
70+
if err := DB.Omit(clause.Associations).Save(&user).Error; err != nil {
7171
t.Fatalf("errors happened when update: %v", err)
7272
}
7373

@@ -103,7 +103,7 @@ func TestUpdateHasManyAssociations(t *testing.T) {
103103
user.Toys[idx].Name += "new"
104104
}
105105

106-
if err := DB.Save(&user).Error; err != nil {
106+
if err := DB.Omit(clause.Associations).Save(&user).Error; err != nil {
107107
t.Fatalf("errors happened when update: %v", err)
108108
}
109109

0 commit comments

Comments
 (0)