Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestCallbacksWithErrors (0.12 sec)

  1. tests/hooks_test.go

    		t.Fatalf("Find don't raise error when record not found")
    	}
    
    	if p.AfterFindCallTimes != beforeCallTimes {
    		t.Fatalf("AfterFind should not be called")
    	}
    }
    
    func TestCallbacksWithErrors(t *testing.T) {
    	DB.Migrator().DropTable(&Product{})
    	DB.AutoMigrate(&Product{})
    
    	p := Product{Code: "Invalid", Price: 100}
    	if DB.Save(&p).Error == nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 17 03:59:06 UTC 2024
    - 16.7K bytes
    - Viewed (0)
Back to top