- Sort Score
- Result 10 results
- Languages All
Results 11 - 15 of 15 for CheckUser (0.11 sec)
-
tests/update_test.go
t.Errorf("errors happened when query before user: %v", err) } CheckUser(t, first, *users[0]) if err := DB.Where("id = ?", users[2].ID).First(&last).Error; err != nil { t.Errorf("errors happened when query after user: %v", err) } CheckUser(t, last, *users[2]) } if err := DB.Create(&users).Error; err != nil { t.Fatalf("errors happened when create: %v", err)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0) -
tests/associations_belongs_to_test.go
func TestBelongsToAssociation(t *testing.T) { user := *GetUser("belongs-to", Config{Company: true, Manager: true}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } CheckUser(t, user, user) // Find var user2 User DB.Find(&user2, "id = ?", user.ID) pointerOfUser := &user2 if err := DB.Model(&pointerOfUser).Association("Company").Find(&user2.Company); err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 9.3K bytes - Viewed (0) -
tests/query_test.go
CheckUser(t, user, users[0]) user = User{} DB.Where(map[string]interface{}{"name": users[1].Name}).First(&user) CheckUser(t, user, users[1]) var results []User DB.Where(map[string]interface{}{"name": users[2].Name}).Find(&results) if len(results) != 1 { t.Fatalf("Search all records with inline map") } CheckUser(t, results[0], users[2])
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 50.4K bytes - Viewed (0) -
tests/helper_test.go
t.Errorf("toys's OwnerType, expect: %v, got %v", "pets", expect.Toy.OwnerType) } } func CheckUserUnscoped(t *testing.T, user User, expect User) { doCheckUser(t, user, expect, true) } func CheckUser(t *testing.T, user User, expect User) { doCheckUser(t, user, expect, false) } func doCheckUser(t *testing.T, user User, expect User, unscoped bool) { if user.ID != 0 { var newUser User
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 8K bytes - Viewed (0) -
tests/sql_builder_test.go
GetUser("row_query_user", Config{}), GetUser("row_query_user", Config{}), } DB.Create(&users) var user User DB.Raw("select * from users WHERE id = ?", users[1].ID).First(&user) CheckUser(t, user, *users[1]) } func TestDryRun(t *testing.T) { user := *GetUser("dry-run", Config{}) dryRunDB := DB.Session(&gorm.Session{DryRun: true}) stmt := dryRunDB.Create(&user).Statement
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 16.7K bytes - Viewed (0)