MCPcopy
hub / github.com/go-gorm/gorm / TestWithUpdateWithInvalidMap

Function TestWithUpdateWithInvalidMap

tests/update_test.go:366–373  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

364}
365
366func TestWithUpdateWithInvalidMap(t *testing.T) {
367 user := *GetUser("update_with_invalid_map", Config{})
368 DB.Create(&user)
369
370 if err := DB.Model(&user).Updates(map[string]string{"name": "jinzhu"}).Error; !errors.Is(err, gorm.ErrInvalidData) {
371 t.Errorf("should returns error for unsupported updating data")
372 }
373}
374
375func TestOmitWithUpdate(t *testing.T) {
376 user := *GetUser("omit_update", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})

Callers

nothing calls this directly

Calls 4

GetUserFunction · 0.85
ModelMethod · 0.80
CreateMethod · 0.65
UpdatesMethod · 0.65

Tested by

no test coverage detected