Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMany2ManyAssociationForSlice (0.25 sec)

  1. tests/associations_many2many_test.go

    	if err := DB.Model(&user).Omit("Languages.*").Association("Languages").Replace(&newLang); err == nil {
    		t.Errorf("should failed to insert languages due to constraint failed, error: %v", err)
    	}
    }
    
    func TestMany2ManyAssociationForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-many2many-1", Config{Languages: 2}),
    		*GetUser("slice-many2many-2", Config{Languages: 0}),
    		*GetUser("slice-many2many-3", Config{Languages: 4}),
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Jun 10 13:05:19 UTC 2023
    - 13.2K bytes
    - Viewed (0)
Back to top