File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ func TestJoinWithSoftDeleted(t *testing.T) {
259
259
260
260
var user1 User
261
261
DB .Model (& User {}).Joins ("NamedPet" ).Joins ("Account" ).First (& user1 , user .ID )
262
- if user1 .NamedPet == nil || user1 .Account .ID == 0 {
262
+ if user1 .NamedPet . ID == 0 || user1 .Account .ID == 0 {
263
263
t .Fatalf ("joins NamedPet and Account should not empty:%v" , user1 )
264
264
}
265
265
@@ -268,17 +268,17 @@ func TestJoinWithSoftDeleted(t *testing.T) {
268
268
269
269
var user2 User
270
270
DB .Model (& User {}).Joins ("NamedPet" ).Joins ("Account" ).First (& user2 , user .ID )
271
- if user2 .NamedPet == nil || user2 .Account .ID != 0 {
272
- t .Fatalf ("joins Account should not empty:%v" , user2 )
271
+ if user2 .NamedPet . ID == 0 || user2 .Account .ID != 0 {
272
+ t .Fatalf ("joins Account should be empty:%v" , user2 )
273
273
}
274
274
275
275
// NamedPet should empty
276
276
DB .Delete (& user1 .NamedPet )
277
277
278
278
var user3 User
279
279
DB .Model (& User {}).Joins ("NamedPet" ).Joins ("Account" ).First (& user3 , user .ID )
280
- if user3 .NamedPet != nil || user2 .Account .ID != 0 {
281
- t .Fatalf ("joins NamedPet and Account should not empty:%v" , user2 )
280
+ if user3 .NamedPet . ID != 0 || user3 .Account .ID != 0 {
281
+ t .Fatalf ("joins NamedPet and Account should be empty:%v" , user3 )
282
282
}
283
283
}
284
284
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ TestCreateWithAutoIncrementCompositeKey
68
68
TestCreateOnConflictWithDefaultNull
69
69
TestCreateFromMapWithoutPK
70
70
TestCreateFromMapWithTable
71
- # TestCustomizeColumn
71
+ TestCustomizeColumn
72
72
TestCustomColumnAndIgnoredFieldClash
73
73
TestCustomizeField
74
74
TestDefaultValue
@@ -142,7 +142,7 @@ TestJoinOn
142
142
TestJoinsWithSelect
143
143
TestJoinWithOmit
144
144
TestJoinCount
145
- # TestJoinWithSoftDeleted
145
+ TestJoinWithSoftDeleted
146
146
TestInnerJoins
147
147
TestJoinWithSameColumnName
148
148
TestJoinArgsWithDB
You can’t perform that action at this time.
0 commit comments