Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestDeletedAtUnMarshal (0.23 sec)

  1. tests/soft_delete_test.go

    	DB.Unscoped().Delete(&user)
    	if err := DB.Unscoped().First(&User{}, "name = ?", user.Name).Error; !errors.Is(err, gorm.ErrRecordNotFound) {
    		t.Errorf("Can't find permanently deleted record")
    	}
    }
    
    func TestDeletedAtUnMarshal(t *testing.T) {
    	expected := &gorm.Model{}
    	b, _ := json.Marshal(expected)
    
    	result := &gorm.Model{}
    	_ = json.Unmarshal(b, result)
    	if result.DeletedAt != expected.DeletedAt {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Feb 01 06:40:55 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top