Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for contents (0.17 sec)

  1. tests/associations_has_many_test.go

    	}
    
    	var contents []ItemContent
    	if err := tx.Find(&contents).Error; err != nil {
    		t.Errorf("failed to find contents, got error: %v", err)
    	}
    	if len(contents) != 3 {
    		t.Errorf("expected %d contents, got %d", 3, len(contents))
    	}
    
    	// test delete
    	if err := tx.Model(&item).Association("Contents").Unscoped().Delete(&contents[0]); err != nil {
    		t.Errorf("failed to delete Contents, got error: %v", err)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  2. tests/update_test.go

    	owner := TokenOwner{
    		Name:  "user",
    		Token: Token{Content: "token"},
    	}
    	o1, err := saveTokenOwner(&owner)
    	if err != nil {
    		t.Errorf("failed to save token owner, got error: %v", err)
    	}
    	if o1.Name != "user_name" {
    		t.Errorf(`owner name should be "user_name", but got: "%s"`, o1.Name)
    	}
    	if o1.Token.Content != "token_encrypted" {
    		t.Errorf(`token content should be "token_encrypted", but got: "%s"`, o1.Token.Content)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. tests/multi_primary_keys_test.go

    	Value  string
    	Blogs  []*Blog `gorm:"many2many:blog_tags"`
    }
    
    func compareTags(tags []Tag, contents []string) bool {
    	var tagContents []string
    	for _, tag := range tags {
    		tagContents = append(tagContents, tag.Value)
    	}
    	sort.Strings(tagContents)
    	sort.Strings(contents)
    	return reflect.DeepEqual(tagContents, contents)
    }
    
    func TestManyToManyWithMultiPrimaryKeys(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
Back to top