Fix slow-ass code

This commit is contained in:
2025-01-13 20:06:55 +01:00
parent ee847020f7
commit d1225d3258
5 changed files with 41 additions and 23 deletions

View File

@ -243,8 +243,8 @@ func TestCreateVotes_UnknownVotersElection(t *testing.T) {
On("Exists", mock.Anything, mock.Anything).
Return(false, nil)
mockVoters.
On("Insert", mock.Anything, mock.Anything).
Return(1, nil)
On("InsertMultiple", mock.Anything, mock.Anything).
Return([]int{1}, nil)
mockVoters.
On("CountByElection", mock.Anything).
Return(0, nil)
@ -634,8 +634,8 @@ func TestCreateVotes_UnknownVotersElectionMaxVotersReached(t *testing.T) {
On("Exists", mock.Anything, mock.Anything).
Return(false, nil)
mockVoters.
On("Insert", mock.Anything, mock.Anything).
Return(1, nil)
On("InsertMultiple", mock.Anything, mock.Anything).
Return([]int{1}, nil)
mockVoters.
On("CountByElection", mock.Anything).
Return(10, nil)