diff --git a/pkg/files/files.go b/pkg/files/files.go index 1357434d..58986647 100644 --- a/pkg/files/files.go +++ b/pkg/files/files.go @@ -17,7 +17,6 @@ package files import ( - "code.vikunja.io/api/pkg/log" "io" "os" "strconv" @@ -25,6 +24,7 @@ import ( "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/db" + "code.vikunja.io/api/pkg/log" "code.vikunja.io/web" "github.com/c2h5oh/datasize" "github.com/spf13/afero" diff --git a/pkg/models/task_comments_test.go b/pkg/models/task_comments_test.go index ea272e27..5397888d 100644 --- a/pkg/models/task_comments_test.go +++ b/pkg/models/task_comments_test.go @@ -195,7 +195,13 @@ func TestTaskComment_ReadAll(t *testing.T) { comments := result.([]*TaskComment) assert.NoError(t, err) assert.Len(t, comments, 2) - assert.Equal(t, int64(-2), comments[0].AuthorID) - assert.NotNil(t, comments[0].Author) + var foundComment bool + for _, comment := range comments { + if comment.AuthorID == -2 { + foundComment = true + } + assert.NotNil(t, comment.Author) + } + assert.True(t, foundComment) }) }