From 8e41f66849fbff52d0aea6e0d15cc664bd7da540 Mon Sep 17 00:00:00 2001 From: Abhijeet Bhowmik Date: Fri, 9 Aug 2024 17:51:09 +0000 Subject: [PATCH] fix: Removed unnecessary UT from pr 7150 --- tests/joins_test.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/joins_test.go b/tests/joins_test.go index b9487945a..497f81467 100644 --- a/tests/joins_test.go +++ b/tests/joins_test.go @@ -476,19 +476,3 @@ func TestJoinsPreload_Issue7013_NoEntries(t *testing.T) { AssertEqual(t, len(entries), 0) } - -func TestJoinWithWrongColumnName_MultipleAfterQueryCalls(t *testing.T) { - type result struct { - gorm.Model - Name string - Pets []*Pet `gorm:"foreignKey:UserID"` - } - user := *GetUser("joins_with_select", Config{Pets: 2}) - DB.Save(&user) - var results []result - var total int64 - assert.NotPanics(t, func() { - err := DB.Table("users").Select("users.id, pets.id as pet_id, pets.name").Joins("left join pets on pets.user_id = users.id").Where("users.name = ? and pets.names = ?", "joins_with_select", "joins_with_select_pet_2").Preload("Pets").Find(&results).Limit(-1).Offset(-1).Count(&total).Error - assert.ErrorContains(t, err, "no such column: pets.names") - }) -}